-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
81 lines (77 loc) · 1.92 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
version: '3'
services:
db:
image: postgres:12-alpine
container_name: db
# increasing shared memory
shm_size: 4gb
environment:
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_DB=$POSTGRES_DB
- TZ=Europe/Berlin
- PGTZ=Europe/Berlin
command: ["-c", "shared_buffers=1024MB"]
profiles:
- production
- development
volumes:
# recreating container and starting reinits the db with files in this dir
- ./database/init:/docker-entrypoint-initdb.d
# use external volume to persist the db state
- ./volumes/db-data:/var/lib/postgresql/data
ports:
- $POSTGRES_PORT_EXT:5432
restart: unless-stopped
db-test:
image: postgres:12-alpine
container_name: db-test
environment:
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_DB=$POSTGRES_TEST_DB
- TZ=Europe/Berlin
- PGTZ=Europe/Berlin
profiles:
- test
volumes:
# recreating container and starting reinits the db with files in this dir
- ./database/init:/docker-entrypoint-initdb.d
ports:
- $POSTGRES_PORT_EXT:5432
restart: unless-stopped
adminer:
image: adminer
ports:
- $ADMINER_PORT_EXT:8080
restart: unless-stopped
scrapyd:
build:
context: .
dockerfile: ./docker/scrapyd.Dockerfile
ports:
- 6800:6800
env_file:
- .env
environment:
- TZ=Europe/Berlin
profiles:
- production
- development
volumes:
- ./volumes/scrapyd:/var/lib/scrapyd
- /usr/local/lib/python3.9/dist-packages
restart: unless-stopped
scheduler:
build:
context: .
dockerfile: ./docker/scheduler.Dockerfile
environment:
- TZ=Europe/Berlin
profiles:
- production
command: ["cron", "-f"]
depends_on:
- scrapyd
- db
restart: unless-stopped