Skip to content

Instantly share code, notes, and snippets.

@zacheryph
Last active May 12, 2020 19:11
Show Gist options
  • Save zacheryph/3cbf4e887f459beca110 to your computer and use it in GitHub Desktop.
Save zacheryph/3cbf4e887f459beca110 to your computer and use it in GitHub Desktop.
# this contains development overrides
version: "3.5"
# common for app/sidekiq
# we volume bundler so we aren't constantly re-installing gems
x-app: &app-common
build:
context: .
target: dev
volumes:
- .:/app
- bundler:/usr/local/bundle
# allow using *.localhost to access in browser
services:
proxy:
image: jwilder/nginx-proxy:alpine
ports:
- 80:80
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./config/nginx-proxy.conf:/etc/nginx/proxy.conf:ro
# support & persist ActiveStorage for development
minio:
image: minio/minio:latest
command: server /data
expose:
- 9000
environment:
- MINIO_ACCESS_KEY
- MINIO_SECRET_KEY
- VIRTUAL_HOST=minio.localhost
volumes:
- minio:/data
web:
<<: *app-common
depends_on:
- frontend
ports:
- 3000:3000
worker: *app-common
frontend:
<<: *app-common
command: ./bin/webpack-dev-server
environment:
VIRTUAL_HOST: frontend.docker
expose:
- 3035
# bind mount the app for writing/saving queries and being
# able to execute them easily within the console if i need to
postgres:
volumes:
- .:/app
expose:
- 5432
volumes:
bundler:
minio:
# we docker-compose template the base & this together
# to generate a combined release compose file.
version: "3.5"
# we keep & maintain nginx-proxy in a separate compose file
# this allows us to run more than one app/compose on the same host
networks:
proxy:
external: true
name: nginx-proxy
services:
postgres:
restart: always
logging:
options:
max-size: "100m"
redis:
restart: always
logging:
options:
max-size: "100m"
grafana:
restart: always
logging:
options:
max-size: "100m"
networks:
- default
- proxy
environment:
- STUFF_HERE
web:
image: ${IMAGE_NAME}
restart: always
logging:
options:
max-size: "100m"
max-file: "10"
networks:
- default
- proxy
environment:
- VIRTUAL_HOST
- RAILS_ENV
- STUFF_HERE
worker:
image: ${IMAGE_NAME}
restart: always
logging:
options:
max-size: "100m"
max-file: "10"
environment:
- RAILS_ENV
- STUFF_HERE
# abe compose file
version: "3.5"
services:
redis:
image: redis:5.0-alpine
volumes:
- redis:/data
postgres:
image: mdillon/postgis:11-alpine
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_USER
- POSTGRES_DB
- POSTGRES_PASSWORD
volumes:
- pgdata:/var/lib/postgresql/data/pgdata
grafana:
image: grafana/grafana:6.3.5
expose:
- 3000
environment:
- HOSTNAME=${GRAFANA_HOST}
- VIRTUAL_HOST=${GRAFANA_HOST}
volumes:
- grafana:/var/lib/grafana
- grafana-etc:/etc/grafana
web:
environment:
- TZ=US/Central
- VIRTUAL_HOST
- STUFF_HERE
expose:
- 3000
depends_on:
- postgres
- redis
worker:
depends_on:
- postgres
- redis
environment:
- TZ=US/Central
- STUFF_HERE
command: sidekiq -q default -q mailers
volumes:
grafana:
grafana-etc:
pgdata:
redis:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment