Initial commit
This commit is contained in:
37
docker-compose.prod.yml
Normal file
37
docker-compose.prod.yml
Normal file
@ -0,0 +1,37 @@
|
||||
services:
|
||||
backend:
|
||||
image: fastapi
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
- JWT_ALGORITHM=${JWT_ALGORITHM}
|
||||
- JWT_EXPIRE_MINUTES=${JWT_EXPIRE_MINUTES}
|
||||
- MONGODB_URL=mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${MONGODB_HOST}:27017
|
||||
- MONGODB_DATABASE=${MONGODB_DATABASE}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
db:
|
||||
image: mongo:7.0
|
||||
environment:
|
||||
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_USER}
|
||||
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD}
|
||||
- MONGO_INITDB_DATABASE=${MONGODB_DATABASE}
|
||||
volumes:
|
||||
- ./docker-data/mongo:/data/db
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
env_file:
|
||||
- .env
|
||||
Reference in New Issue
Block a user