Last active
April 2, 2025 15:12
-
-
Save donrestarone/e9facdf2efdc7fee7e49ad6bac706548 to your computer and use it in GitHub Desktop.
simple docker-compose file for dockerizing the restarone website
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
@donrestarone What this
shared_data:/var/shared
doing in 3 services?