-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
45 lines (45 loc) · 1.35 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
version: '3'
services:
scrapyd:
build:
context: .
dockerfile: scrapyd/Dockerfile
ports:
- "6800:6800"
depends_on:
- db
- redis
container_name: "autoproxy_scrapyd"
redis:
image: "redis:alpine"
command: redis-server --requirepass somepassword
ports:
- "5379:6379"
container_name: "autoproxy_redis"
db:
# Use the Docker Image postgres. This will pull the newest release.
image: "postgres"
# Give the container the name my_postgres. You can changes to something else.
container_name: "autoproxy_db"
# Setup the username, password, and database name. You can changes these values.
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=somepassword
- POSTGRES_DB=proxies
# Maps port 54320 (localhost) to port 5432 on the container. You can change the ports to fix your needs.
ports:
- "54320:5432"
# Set a volume some that database is not lost after shutting down the container.
# I used the name postgres-data but you can changed it to something else.
volumes:
- autoproxy_pgdata:/var/lib/postgresql/data
- ./data/init_sql:/docker-entrypoint-initdb.d
spider_scheduler:
build:
context: .
dockerfile: scheduler/Dockerfile
depends_on:
- scrapyd
container_name: autoproxy_scheduler
volumes:
autoproxy_pgdata: