-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yml
64 lines (58 loc) · 1.85 KB
/
docker-compose-dev.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
services:
postgres:
image: postgres:latest
container_name: postgres_prod
ports:
- "6500:5432" # Map host port 6500 to container's port 5432
volumes:
- progresDB:/var/lib/postgresql/data # Persistent data volume
env_file:
- ./.env # Make sure the .env file contains necessary database credentials
networks:
- app_network_prod
pgAdmin:
image: dpage/pgadmin4
container_name: pgAdmin_prod
env_file:
- ./.env # Use the same .env file to configure pgAdmin
ports:
- "5050:80" # Expose pgAdmin UI on host port 5050
networks:
- app_network_prod
backend:
build:
context: ./backend/api
dockerfile: Dockerfile
container_name: cardanoapiio_backend
ports:
- "8000:8000"
depends_on:
- postgres
environment:
# Use the service name 'postgres' instead of localhost
DATABASE_URL: postgresql://admin:saisab@postgres:5432/rust_sqlx?schema=public
volumes:
- .backend/api/src:/app/src:ro
networks:
- app_network_prod
frontend:
build:
context: . # Root context for frontend (Next.js app)
dockerfile: Dockerfile # Dockerfile location for frontend
container_name: nextjs_frontend_prod
ports:
- "3000:3000" # Expose frontend on host port 3000
environment:
# The frontend needs to know where the API is hosted
API_URL: http://backend:8000 # Use 'backend' as the service name for internal communication
NODE_ENV: production # Set NODE_ENV to production in the frontend container
restart: always # Automatically restart frontend on failure
depends_on:
- backend # Ensure frontend starts after backend is up
networks:
- app_network_prod
networks:
app_network_prod:
driver: bridge # Use the bridge network for communication between containers
volumes:
progresDB: