forked from brandonrobertz/autoscrape-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (68 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
# Bring up all the pieces necessary to run the workbench
# Data persists in Docker volumes and in local dir
# This file passes through all necessary env variables to requisite
# Docker containers and makes them available when running commands via
# `docker exec`.
version: '3.4'
services:
database:
image: postgres:10.10
environment:
POSTGRES_USER: autoscrape
POSTGRES_PASSWORD: autoscrape
POSTGRES_DB: autoscrape
PGDATA: /var/lib/postgresql/data/10.10
networks: [ 'dev' ]
volumes:
- dbdata:/var/lib/postgresql/data
rabbitmq:
image: rabbitmq:3.7.8-management
ports: [ '15672' ] # open management port, for debugging
networks: [ 'dev' ]
environment:
# Use just one CPU
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: '+S 1:1 +stbt ts +A 12'
flask:
build:
context: .
target: base
volumes:
- ./:/app:rw
- virtualenvs:/root/.local/share/virtualenvs/:rw
command: [ 'python3', 'autoscrape-server.py' ]
ports:
- '5000:5000'
links:
- rabbitmq
depends_on: [ 'rabbitmq', 'database' ]
networks: [ 'dev' ]
environment:
AUTOSCRAPE_RABBITMQ_HOST: amqp://guest:guest@rabbitmq/
AUTOSCRAPE_DB_HOST: database
AUTOSCRAPE_DB_USER: autoscrape
AUTOSCRAPE_DB_PASSWORD: autoscrape
celery:
build:
context: .
target: base
shm_size: 6GB
volumes:
- ./:/app:rw
- virtualenvs:/root/.local/share/virtualenvs/:rw
command: [ 'celery', '-c', '1', '-A', 'autoscrape.tasks', 'worker', '--loglevel=info' ]
#user: nobody
links:
- rabbitmq
depends_on: [ 'rabbitmq', 'flask', 'database' ]
networks: [ 'dev' ]
environment:
AUTOSCRAPE_RABBITMQ_HOST: amqp://guest:guest@rabbitmq/
AUTOSCRAPE_DB_HOST: database
AUTOSCRAPE_DB_USER: autoscrape
AUTOSCRAPE_DB_PASSWORD: autoscrape
networks:
dev:
driver: bridge
volumes:
virtualenvs: {}
dbdata: {}