-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
42 lines (38 loc) · 973 Bytes
/
docker-compose.test.yml
File metadata and controls
42 lines (38 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: '3.8'
services:
fastapi:
build:
context: .
dockerfile: Dockerfile.test # Path to your Dockerfile for FastAPI
ports:
- "8000:8000" # Port mapping (host:container)
extra_hosts:
- "host.docker.internal:host-gateway" # Required for Docker
depends_on:
- mongodb # Depends on the MongoDB service
environment:
MONGO_DB_HOST: mongodb
MONGO_DB_PORT: 27017
MONGO_DB_DATABASE: test
MONGO_DB_USERNAME: dev
MONGO_DB_PASSWORD: dev
SECRET_KEY: secret
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 1030
REFRESH_TOKEN_EXPIRE_DAYS: 30
networks:
- mynetwork
mongodb:
image: mongo:latest
ports:
- "27018:27017" # Port mapping (host:container)
volumes:
- mongodb_data:/data/db # Volume for MongoDB data persistence
networks:
- mynetwork
networks:
mynetwork:
driver: bridge
volumes:
mongodb_data:
driver: local