Skip to content

Instantly share code, notes, and snippets.

@beauraF
Last active November 3, 2019 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beauraF/dd4f586d33dc560fe2b8ac6bc7c3019b to your computer and use it in GitHub Desktop.
Save beauraF/dd4f586d33dc560fe2b8ac6bc7c3019b to your computer and use it in GitHub Desktop.
Simple docker-compose configuration for Rails
version: '3'
services:
postgres:
container_name: my_rails_project_postgres
image: postgres:11.5-alpine
ports: ['5432:5432']
environment:
POSTGRES_USER: ${USER}
volumes:
- ./tmp/db:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', '${USER}']
interval: 10s
timeout: 5s
retries: 5
redis:
container_name: my_rails_project_redis
image: redis:5.0.6-alpine
ports: ['6379:6379']
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
maildev:
container_name: my_rails_project_maildev
image: djfarrelly/maildev:latest
ports:
- '1080:80'
- '1025:25'
healthcheck:
test: ['CMD', 'curl', '--fail', 'http://localhost']
interval: 10s
timeout: 5s
retries: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment