@@ -3,15 +3,15 @@ services:
33 postgres :
44 image : postgres:15-alpine
55 environment :
6- POSTGRES_DB : prostaff_api_development
7- POSTGRES_USER : postgres
8- POSTGRES_PASSWORD : password
6+ POSTGRES_DB : ${POSTGRES_DB:- prostaff_api_development}
7+ POSTGRES_USER : ${POSTGRES_USER:- postgres}
8+ POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:- password}
99 volumes :
1010 - postgres_data:/var/lib/postgresql/data
1111 ports :
12- - " 5432:5432"
12+ - " ${POSTGRES_PORT:- 5432} :5432"
1313 healthcheck :
14- test : ["CMD-SHELL", "pg_isready -U postgres"]
14+ test : ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:- postgres} "]
1515 interval : 10s
1616 timeout : 5s
1717 retries : 5
@@ -22,7 +22,7 @@ services:
2222 volumes :
2323 - redis_data:/data
2424 ports :
25- - " 6399 :6379"
25+ - " ${REDIS_PORT:-6379} :6379"
2626 healthcheck :
2727 test : ["CMD", "redis-cli", "ping"]
2828 interval : 10s
@@ -33,34 +33,35 @@ services:
3333 api :
3434 build : .
3535 environment :
36- DATABASE_URL : postgresql://postgres:password@postgres:5432/prostaff_api_development
37- REDIS_URL : redis://redis:6379/0
38- RAILS_ENV : development
39- JWT_SECRET_KEY : your_jwt_secret_key_for_development
40- CORS_ORIGINS : http://localhost:5173,http://localhost:8080,http://localhost:3001
36+ DATABASE_URL : ${DATABASE_URL}
37+ REDIS_URL : ${REDIS_URL:-redis://redis:6379/0}
38+ RAILS_ENV : ${RAILS_ENV:-development}
39+ JWT_SECRET_KEY : ${JWT_SECRET_KEY}
40+ CORS_ORIGINS : ${CORS_ORIGINS}
41+ RIOT_API_KEY : ${RIOT_API_KEY}
4142 volumes :
4243 - .:/app
4344 - bundle_cache:/usr/local/bundle
4445 ports :
45- - " 3333:3000"
46+ - " ${API_PORT:- 3333} :3000"
4647 depends_on :
47- postgres :
48- condition : service_healthy
4948 redis :
5049 condition : service_healthy
5150 command : >
5251 sh -c "
53- bundle exec rails db:create db:migrate db:seed &&
54- bundle exec rails server -b 0.0.0.0
52+ rm -f tmp/pids/server.pid &&
53+ bundle exec rails db:migrate &&
54+ bundle exec rails server -b 0.0.0.0 -p 3000
5555 "
5656
5757 # Sidekiq for background jobs
5858 sidekiq :
5959 build : .
6060 environment :
61- DATABASE_URL : postgresql://postgres:password@postgres:5432/prostaff_api_development
62- REDIS_URL : redis://redis:6379/0
63- RAILS_ENV : development
61+ DATABASE_URL : ${DATABASE_URL}
62+ REDIS_URL : ${REDIS_URL:-redis://redis:6379/0}
63+ RAILS_ENV : ${RAILS_ENV:-development}
64+ JWT_SECRET_KEY : ${JWT_SECRET_KEY}
6465 volumes :
6566 - .:/app
6667 - bundle_cache:/usr/local/bundle
0 commit comments