Initial commit
This commit is contained in:
40
docker-compose.yml
Normal file
40
docker-compose.yml
Normal file
@ -0,0 +1,40 @@
|
||||
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}@db:27017
|
||||
- MONGODB_DATABASE=${MONGODB_DATABASE}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
command: fastapi dev --host 0.0.0.0
|
||||
volumes:
|
||||
- ./app:/app/app
|
||||
|
||||
db:
|
||||
image: mongo:7.0
|
||||
environment:
|
||||
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_USER}
|
||||
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD}
|
||||
- MONGO_INITDB_DATABASE=${MONGODB_DATABASE}
|
||||
ports:
|
||||
- "27017:27017"
|
||||
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