-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
53 lines (50 loc) · 1.17 KB
/
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
45
46
47
48
49
50
51
52
53
version: '3.8'
networks:
noda_network:
services:
backend:
container_name: noda_backend
image: golang:1.22.5-alpine3.20
volumes:
- type: bind
source: .
target: /src
command: >
sh -c "
cd /src &&
echo 'Installing Go dependencies...' &&
go mod download &&
echo 'Go dependencies installed.' &&
sleep infinity
"
ports:
- "7890:7890"
networks:
- noda_network
environment:
- SERVER_PORT=7890
- PG_NAME=master
- PG_USER=worker
- PG_PORT=5432
- PG_HOST=noda_database
- PG_PASSWORD=secret
- JWT_SECRET='AJW[;>qs)-gkpQfM@};K7jRS?d)T)3vx$3[]aUp>3$%+3rE;w@X{,2@/[(XT8^G*])
database:
container_name: noda_database
image: postgres:16rc1-alpine3.18
restart: unless-stopped
networks:
- noda_network
ports:
- "7891:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 10s
timeout: 5s
retries: 3
volumes:
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./database:/src
environment:
- POSTGRES_PASSWORD=secret
- PROJECT_DIR=/src