# A postgresql container to store all your dev dataz! | |
pg: | |
# cade/webmaker-postgres is a slightly customized version of the official Docker Hub postgres container | |
image: cade/webmaker-postgres | |
# Enable host networking for the container - effectively making th containers 'localhost' the same as the host | |
net: "host" | |
# Mounts the pg_data folder in this repo to the containers filesystem. | |
# cade/webmaker-postgres is configured to use /var/lib/postgresql/data/pg_data to store data | |
volumes: | |
- ./pg_data:/var/lib/postgresql/data/pg_data | |
# I don't think I need these with host networking, but it is suppose to bind the containers port (on left) to the host port (on right) | |
ports: | |
- "5432:5432" | |
# A MariaDB container for loginAPI (soon to be removed) | |
mariadb: | |
image: mariadb:10 | |
net: "host" | |
# Docker Compose will load this env file and apply the values to the containers environment | |
env_file: compose.mariadb.env | |
# Mounts the mariadb_data folder in this repo to the containers filesystem. | |
# MariaDB will store your data here! | |
volumes: | |
- ./mariadb_data:/var/lib/mysql | |
ports: | |
- "3306:3306" | |
# A Redis cache container, for the caching needs of Webmaker API and ID | |
redis: | |
image: redis:3 | |
net: "host" | |
ports: | |
- "6379:6379" |
# Webmaker API | |
# Use this image as the base for our new one. | |
FROM ubuntu:14.04.2 | |
# Specify a maintainer | |
MAINTAINER Mozilla Foundation <cade@mozillafoundation.org> | |
# install curl | |
RUN apt-get update && apt-get install -y \ | |
curl | |
# Install nodejs LTS PPA | |
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - | |
# install nodejs LTS | |
RUN apt-get update && apt-get install -y \ | |
nodejs | |
# create webmaker user | |
RUN useradd -d /webmaker webmaker | |
# set working directory | |
WORKDIR /webmaker | |
# Add webmaker-api source code and dependencies | |
COPY . ./ | |
# copy sample env file | |
RUN cp env.sample .env | |
# Expose default webmaker-api port | |
EXPOSE 2015 | |
# fix permissions :| | |
RUN chown -R webmaker:webmaker . | |
# tell docker to run the CMD as this user | |
USER webmaker | |
# Command to execute when starting Webmaker API | |
CMD ["node","server"] |
# The Webmaker API image | |
webmaker: | |
image: cade/webmaker-api:latest | |
# Docker Compose will load this env file and apply the values to the containers environment | |
# This is really useful for customizing the webmaker services configuration | |
env_file: compose.webmaker.env | |
net: "host" | |
# The webmaker ID (OAuth 2) provider | |
id: | |
image: cade/webmaker-id:latest | |
env_file: compose.id.env | |
net: "host" | |
# The legacy Webmaker LoginAPI (soon to be deprecated) | |
loginapi: | |
image: cade/legacy-webmaker-login:latest | |
env_file: compose.loginapi.env | |
net: "host" |