forked from SebasGA19/spAInews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose-dev-api.yaml
96 lines (93 loc) · 2.09 KB
/
compose-dev-api.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
# 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
- ./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
- ./mariadb-data:/var/lib/mysql
environment:
MARIADB_ROOT_PASSWORD: spainews
MARIADB_DATABASE: spainews
MARIADB_USER: spainews
MARIADB_PASSWORD: spainews
smtp:
networks:
- spainews
container_name: spainews-mailhog
restart: unless-stopped
image: mailhog/mailhog
api:
depends_on:
- smtp
- 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.1"
build:
context: .
dockerfile: crawler.Dockerfile