-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
107 lines (104 loc) · 2.35 KB
/
docker-compose.yaml
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
# This docker compose will only be used by frontend developers since it isolates the database by the API interfaces
# Ports:
# - API -> 127.0.0.1:5000
version: "3.3"
networks:
spainews:
external: false
services:
redis:
networks:
- spainews
container_name: spainews-redis
image: redis:latest
restart: unless-stopped
mongo:
container_name: spainews-mongo
image: mongo:latest
restart: unless-stopped
networks:
- spainews
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_DATABASE: spainews
volumes:
- type: bind
source: ./mongo-initdb.d
target: /docker-entrypoint-initdb.d
read_only: true
- /opt/spAInews/mongo-data:/data/db
mariadb:
networks:
- spainews
container_name: spainews-mariadb
restart: unless-stopped
image: mariadb:latest
volumes:
- type: bind
source: ./mariadb-init.d
target: /docker-entrypoint-initdb.d
read_only: true
- /opt/spAInews/mariadb-data:/var/lib/mysql
environment:
MARIADB_ROOT_PASSWORD: spainews
MARIADB_DATABASE: spainews
MARIADB_USER: spainews
MARIADB_PASSWORD: spainews
api:
depends_on:
- redis
- mariadb
- mongo
user: "api:api"
container_name: spainews-api
build:
context: .
dockerfile: api.Dockerfile
volumes:
- type: bind
source: ./configs/api
target: /configs
read_only: true
restart: unless-stopped
networks:
- spainews
ports:
- "127.0.0.1:5000:5000"
crawler:
depends_on:
- mongo
restart: on-failure
networks:
- spainews
container_name: spainews-crawler
volumes:
- type: bind
source: ./configs/crawler
target: /configs
read_only: true
deploy:
resources:
limits:
cpus: "0.2"
build:
context: .
dockerfile: crawler.Dockerfile
frontend:
depends_on:
- api
user: "frontend:frontend"
container_name: spainews-frontend
build:
context: .
dockerfile: frontend.Dockerfile
volumes:
- type: bind
source: ./configs/frontend
target: /configs
read_only: true
restart: unless-stopped
networks:
- spainews
ports:
- "127.0.0.1:8000:3000"