Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
simple docker-compose file for dockerizing the restarone website
version: '3'
networks:
development:
test:
volumes:
db_data:
gem_cache:
shared_data:
services:
restarone_redis:
image: redis:4.0-alpine
command: redis-server
networks:
- development
- test
volumes:
- shared_data:/var/shared/redis
restarone_db:
image: postgres:12.5-alpine
container_name: restarone_db
volumes:
- db_data:/var/lib/postgresql/data
- shared_data:/var/shared
networks:
- development
- test
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5099:5432
restarone_app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: restarone_app
volumes:
- .:/var/app
- shared_data:/var/shared
- gem_cache:/usr/local/bundle/gems
networks:
- development
ports:
- 3000:3000
stdin_open: true
tty: true
env_file: .env.development
entrypoint: dev-entrypoint.sh
command: ['rails', 'server', '-p', '3000', '-b', '0.0.0.0']
environment:
RAILS_ENV: development
depends_on:
- restarone_db
restarone_test:
image: restarone_restarone_app
container_name: restarone_test
volumes:
- .:/var/app
- shared_data:/var/shared
- gem_cache:/usr/local/bundle/gems
networks:
- test
ports:
- 3001:3000
stdin_open: true
tty: true
env_file: .env.test
entrypoint: test-entrypoint.sh
command: ["rails", "-v"]
environment:
RAILS_ENV: test
depends_on:
- restarone_db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment