-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (41 loc) · 883 Bytes
/
docker-compose.yml
File metadata and controls
46 lines (41 loc) · 883 Bytes
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
services:
web:
build: .
ports:
- '3000:3000'
environment:
- NODE_ENV=production
- DATABASE_URL=postgres://postgres:postgres@db:5432/todos
depends_on:
- db
networks:
- my_network
db:
image: postgres:17
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-todos}
ports:
- '5433:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- my_network
cron:
image: alpine/curl
command: >
sh -c "
echo '*/10 * * * * curl -X POST http://web:3000/db/clear' > /etc/crontabs/root && \
crond -f -l 2
"
depends_on:
- web
networks:
- my_network
volumes:
postgres_data:
networks:
my_network:
name: my_network
driver: bridge