-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
147 lines (140 loc) · 3.22 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
services:
traefik:
image: traefik:v3.1.2
command:
- "--api.insecure=true" # Enable dashboard for local dev
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.remix.address=:3000"
ports:
- "3000:3000"
- "8080:8080" # Traefik dashboard
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- net
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
db:
image: postgres:latest
volumes:
- postgres_db:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST_AUTH_METHOD=trust
networks:
- net
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
pgbouncer:
container_name: pgbouncer
image: edoburu/pgbouncer:latest
environment:
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=db
- DB_NAME=sill
- AUTH_TYPE=scram-sha-256
- POOL_MODE=transaction
- ADMIN_USERS=postgres
ports:
- "5432:5432"
depends_on:
- db
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
healthcheck:
test: ['CMD', 'pg_isready', '-h', 'localhost']
remix:
image: sill-app
build:
context: ./
dockerfile: Dockerfile
env_file:
- .env
environment:
- NODE_ENV=development
depends_on:
- db
networks:
- net
volumes:
- ${APP_DIR}:/app
- /app/node_modules
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=Host(`${WEB_DOMAIN}`) || Host(`127.0.0.1`)"
- "traefik.http.services.web.loadbalancer.server.port=3000"
command: ["npm", "run", "dev"]
worker:
image: sill-app
build:
context: ./
dockerfile: Dockerfile
env_file:
- .env
environment:
- NODE_ENV=development
depends_on:
- db
networks:
- net
volumes:
- ${APP_DIR}:/app
- /app/node_modules
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
command: npm run dev:worker
restart: unless-stopped
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# - /path/to/dozzle/data:/data
- ./dozzle/data:/data
networks:
- net
environment:
DOZZLE_NO_ANALYTICS: true
DOZZLE_AUTH_PROVIDER: simple
labels:
- "traefik.enable=true"
- "traefik.http.routers.dozzle.rule=Host(`${DOZZLE_DOMAIN}`)"
- "traefik.http.services.dozzle.loadbalancer.server.port=8080"
healthcheck:
test: ["CMD", "/dozzle", "healthcheck"]
interval: 3s
timeout: 30s
retries: 5
start_period: 30s
volumes:
postgres_db:
networks:
net:
driver: bridge