-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (51 loc) · 1.44 KB
/
docker-compose.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
version: '3' #This denotes that we are using version 3 of Docker Compose
services: #This section defines all the different containers we will create.
postgres_service:
container_name: postgres_container
image: postgres:12.9
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-123}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
# expose: # Publishes 7775 to other containers but NOT to host machine
# - "7775"
ports:
- "5432:5432"
networks:
- bloggy-network
restart: unless-stopped
# command: -p 7775
bloggy_server:
command: start:prod
container_name: bloggy_server_container
build:
context: ./
environment:
- DB_HOST=postgres_container
- DB_PORT=5432
- DB_USERNAME=postgres
- DB_PASSWORD=123
ports: #This is used to map the container’s ports to the host machine.
- "5000:5000"
depends_on:
- postgres_service
networks:
- bloggy-network
bloggy_client: #This is the name of our Nextjs application.
command: serve
container_name: bloggy_client_container
build:
context: ./src/presentation/ui
ports: #This is used to map the container’s ports to the host machine.
- "3000:3000"
depends_on:
- bloggy_server
networks:
- bloggy-network
networks:
bloggy-network:
driver: bridge
volumes:
postgres: