-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
98 lines (92 loc) · 2.1 KB
/
docker-compose.yaml
File metadata and controls
98 lines (92 loc) · 2.1 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
services:
user:
build:
context: ./user
dockerfile: Dockerfile
container_name: r3f-app
working_dir: /user
ports:
- "5173:5173"
volumes:
- ./user:/user
- /user/node_modules
- /user/dist
networks:
- app_network
admin:
build:
context: ./admin
dockerfile: Dockerfile
container_name: admin-app
working_dir: /app
ports:
- "3000:3000"
volumes:
- ./admin:/app
- /app/node_modules
- /app/.next
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8080
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
networks:
- app_network
depends_on:
- app
app:
build:
context: ./api
dockerfile: Dockerfile
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_HOST: ${POSTGRES_HOST}
SWAGGER_URL: ${SWAGGER_URL}
SWAGGER_STG_URL: ${SWAGGER_STG_URL}
ports:
- "8080:8080"
volumes:
- ./api:/app
working_dir: /app
command: sh -c "go mod tidy && go run main.go"
networks:
- app_network
depends_on:
- db
db:
image: postgres:15
container_name: postgres
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256"
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- app_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
swagger-ui:
image: swaggerapi/swagger-ui
restart: unless-stopped
ports:
- "8081:8080"
volumes:
- ./openapi.yaml:/openapi.yaml
networks:
- app_network
environment:
SWAGGER_JSON: /openapi.yaml
volumes:
postgres-data:
networks:
app_network: