-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
44 lines (41 loc) · 1.04 KB
/
docker-compose.yaml
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
version: "3.9"
services:
db:
image: postgres:14
container_name: postgres_container
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: attendance
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
go_server:
build:
context: .
dockerfile: Dockerfile
container_name: go_server_container
ports:
- "8080:8080" # Map the port your Go server listens on
depends_on:
- db # Ensures that the db service is started before go_server
environment:
DB_HOST: db # The name of the db service in Docker Compose network
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: attendance
nginx:
image: nginx:alpine
container_name: nginx_container
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- /etc/letsencrypt:/etc/letsencrypt:ro # Mounting Let's Encrypt certificates
depends_on:
- go_server
volumes:
postgres_data: