2020-04-05 02:58:41 +00:00
|
|
|
version: "3.4"
|
2018-04-23 15:29:07 +00:00
|
|
|
|
|
|
|
services:
|
2020-04-05 02:58:41 +00:00
|
|
|
#
|
2020-04-08 19:25:24 +00:00
|
|
|
# Main services
|
2020-04-05 02:58:41 +00:00
|
|
|
#
|
2020-04-08 19:25:24 +00:00
|
|
|
production:
|
|
|
|
command: "bundle exec puma"
|
|
|
|
tty: true
|
|
|
|
stdin_open: true
|
|
|
|
container_name: "ensl_production"
|
|
|
|
user: "web:web"
|
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
target: ensl_production
|
|
|
|
volumes:
|
|
|
|
- ".:/var/www/"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: production
|
|
|
|
ports:
|
|
|
|
- "${PUMA_PORT}:${PUMA_PORT}"
|
|
|
|
# Guard livereload
|
|
|
|
# - "35729:35729"
|
|
|
|
links:
|
|
|
|
- db
|
|
|
|
- memcached
|
|
|
|
- smtp
|
|
|
|
|
|
|
|
staging:
|
|
|
|
# command: "/bin/bash"
|
|
|
|
# command: "/var/www/bin/script/entry.sh"
|
|
|
|
command: "bundle exec puma"
|
|
|
|
tty: true
|
|
|
|
stdin_open: true
|
|
|
|
container_name: "ensl_staging"
|
|
|
|
user: "web:web"
|
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
target: ensl_staging
|
|
|
|
volumes:
|
|
|
|
- ".:/var/www/"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: staging
|
|
|
|
ports:
|
|
|
|
- "9000:${PUMA_PORT}"
|
|
|
|
links:
|
|
|
|
- db
|
|
|
|
- memcached
|
|
|
|
- smtp
|
|
|
|
|
|
|
|
development:
|
2020-04-05 02:58:41 +00:00
|
|
|
# For debug; Use attach rather than this
|
|
|
|
# command: /bin/bash
|
|
|
|
command: "bundle exec puma"
|
|
|
|
tty: true
|
|
|
|
stdin_open: true
|
2020-04-08 19:25:24 +00:00
|
|
|
container_name: "ensl_development"
|
2020-04-05 02:58:41 +00:00
|
|
|
user: "web:web"
|
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
target: ensl_${RAILS_ENV}
|
2018-04-25 16:41:22 +00:00
|
|
|
volumes:
|
2020-04-05 02:58:41 +00:00
|
|
|
- ".:/var/www/"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: $RAILS_ENV
|
2018-04-23 15:29:07 +00:00
|
|
|
ports:
|
2020-04-05 02:58:41 +00:00
|
|
|
- "${PUMA_PORT}:${PUMA_PORT}"
|
|
|
|
- "35729:35729"
|
|
|
|
links:
|
2018-04-23 15:29:07 +00:00
|
|
|
- db
|
|
|
|
- memcached
|
2020-04-06 00:31:05 +00:00
|
|
|
|
2020-04-05 02:58:41 +00:00
|
|
|
#
|
|
|
|
# Testing
|
|
|
|
#
|
|
|
|
|
|
|
|
# Seperate test container so dev / test don't cause problems
|
|
|
|
test:
|
|
|
|
command: ["bash", "-c", "while true; do sleep 100; done;"]
|
|
|
|
container_name: ensl_test
|
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
target: ensl_development
|
|
|
|
env_file:
|
|
|
|
- .env.test
|
|
|
|
ports:
|
|
|
|
- ${TEST_APP_PORT}:${TEST_APP_PORT} # Capybara listens here
|
|
|
|
links:
|
|
|
|
- db
|
|
|
|
- memcached
|
|
|
|
- selenium
|
|
|
|
volumes:
|
|
|
|
- ".:/var/www"
|
|
|
|
# command: bin/spring server
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: test
|
|
|
|
networks:
|
|
|
|
default:
|
|
|
|
aliases:
|
|
|
|
- test
|
|
|
|
|
|
|
|
selenium:
|
|
|
|
image: selenium/standalone-chrome-debug
|
2020-04-06 00:31:05 +00:00
|
|
|
container_name: ensl_selenium
|
2020-04-05 02:58:41 +00:00
|
|
|
ports:
|
|
|
|
- 5900:5900
|
|
|
|
- 4444:4444
|
|
|
|
|
|
|
|
#
|
|
|
|
# Common services: These are shared by all envs.
|
|
|
|
#
|
|
|
|
|
|
|
|
memcached:
|
|
|
|
image: memcached:alpine
|
2020-04-06 00:31:05 +00:00
|
|
|
container_name: ensl_memcached
|
2020-04-05 02:58:41 +00:00
|
|
|
|
|
|
|
redis:
|
|
|
|
image: 'redis:4.0-alpine'
|
2020-04-06 00:31:05 +00:00
|
|
|
container_name: ensl_redis
|
2020-04-05 02:58:41 +00:00
|
|
|
|
2018-04-23 15:29:07 +00:00
|
|
|
db:
|
|
|
|
image: mariadb:latest
|
2020-04-06 00:31:05 +00:00
|
|
|
container_name: ensl_db
|
2020-04-05 02:58:41 +00:00
|
|
|
user: "mysql:mysql"
|
|
|
|
# debug; command: mysqld_safe --skip-grant-tables
|
2018-04-23 15:29:07 +00:00
|
|
|
volumes:
|
2020-04-05 02:58:41 +00:00
|
|
|
- "./db/data:/var/lib/mysql"
|
|
|
|
- "./db/initdb.d:/docker-entrypoint-initdb.d"
|
2018-04-25 16:41:22 +00:00
|
|
|
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
|
2018-04-23 15:29:07 +00:00
|
|
|
environment:
|
2020-04-05 02:58:41 +00:00
|
|
|
- MYSQL_DATABASE=$MYSQL_DATABASE
|
|
|
|
- MYSQL_USER=$MYSQL_USER
|
|
|
|
- MYSQL_PASSWORD=$MYSQL_PASSWORD
|
|
|
|
- MYSQL_ROOT_PASSWORD=$MYSQL_PASSWORD
|
|
|
|
- MYSQL_ROOT_HOST=$MYSQL_ROOT_HOST
|
|
|
|
|
2019-10-14 20:26:43 +00:00
|
|
|
smtp:
|
|
|
|
image: mwader/postfix-relay:latest
|
2020-04-06 00:31:05 +00:00
|
|
|
container_name: ensl_smtp
|
2019-10-14 20:26:43 +00:00
|
|
|
restart: always
|
|
|
|
volumes:
|
2020-04-05 02:58:41 +00:00
|
|
|
- "./ext/dkim:/etc/opendkim/keys"
|
2019-10-14 20:26:43 +00:00
|
|
|
environment:
|
2020-04-08 19:25:24 +00:00
|
|
|
- POSTFIX_myhostname=$MAIL_DOMAIN
|
|
|
|
- OPENDKIM_DOMAINS=$MAIL_DOMAIN
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
image: nginx:latest
|
|
|
|
container_name: ensl_nginx
|
|
|
|
tty: true
|
|
|
|
stdin_open: true
|
|
|
|
command: /bin/bash -c "envsubst '$$PUMA_PORT $$APP_PATH $$APP_PATH_PUBLIC $$STAGING_ROOT_DOMAIN $$STAGING_DOMAIN $$STAGING_PORT $$STAGING_PORT_SSL' < /etc/nginx/conf.d/*.conf.template > /etc/nginx/conf.d/default.conf && cat /etc/nginx/conf.d/*.conf && nginx -g 'daemon off;'"
|
|
|
|
volumes:
|
2020-04-09 00:36:19 +00:00
|
|
|
- ./ext/ssl:/etc/ssl/ensl
|
2020-04-08 19:25:24 +00:00
|
|
|
- ./ext/nginx.conf.d/:/etc/nginx/conf.d/
|
|
|
|
- ./public:/var/www/public
|
|
|
|
ports:
|
|
|
|
- $STAGING_PORT:$STAGING_PORT
|
|
|
|
- $STAGING_PORT_SSL:$STAGING_PORT_SSL
|
|
|
|
environment:
|
|
|
|
- PUMA_PORT=$PUMA_PORT
|
|
|
|
- STAGING_ROOT_DOMAIN=$STAGING_ROOT_DOMAIN
|
|
|
|
- STAGING_DOMAIN=$STAGING_DOMAIN
|
|
|
|
- STAGING_PORT=$STAGING_PORT
|
|
|
|
- STAGING_PORT_SSL=$STAGING_PORT_SSL
|
|
|
|
- RAILS_ENV=$RAILS_ENV
|
|
|
|
- APP_PATH=$APP_PATH
|
|
|
|
- APP_PATH_PUBLIC=$APP_PATH_PUBLIC
|
2020-04-05 02:58:41 +00:00
|
|
|
|
|
|
|
# spring:
|
|
|
|
# build:
|
|
|
|
# context: ./
|
|
|
|
# dockerfile: Dockerfile.dev
|
|
|
|
# args:
|
|
|
|
# buildno: 1
|
|
|
|
# volumes:
|
|
|
|
# - .:/var/www
|
|
|
|
# command: spring server
|
|
|
|
# This ensures that the pid namespace is shared between the host
|
|
|
|
# and the container. It's not necessary to be able to run spring
|
|
|
|
# commands, but it is necessary for "spring status" and "spring stop"
|
|
|
|
# to work properly.
|
2020-04-09 00:36:19 +00:00
|
|
|
# pid: host
|