-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
75 lines (72 loc) · 2.72 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
version: '3.8'
services:
backend:
build: ./
restart: always
depends_on:
- mongo-a
links:
- mongo-a
labels:
# Enable Traefik for this specific "backend" service
- traefik.enable=true
# Define the port inside of the Docker service to use
- traefik.http.services.app.loadbalancer.server.port=80
# Make Traefik use this domain in HTTP
- traefik.http.routers.app-http.entrypoints=http
- traefik.http.routers.app-http.rule=Host(`psidomaincheck.es`)
# Use the traefik-public network (declared below)
- traefik.docker.network=traefik-public
# Make Traefik use this domain in HTTPS
- traefik.http.routers.app-https.entrypoints=https
- traefik.http.routers.app-https.rule=Host(`psidomaincheck.es`)
- traefik.http.routers.app-https.tls=true
# Use the "le" (Let's Encrypt) resolver
- traefik.http.routers.app-https.tls.certresolver=le
# https-redirect middleware to redirect HTTP to HTTPS
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
# Middleware to redirect HTTP to HTTPS
- traefik.http.routers.app-http.middlewares=https-redirect
# Configure ratelimit middleware
- traefik.http.middlewares.api-ratelimit.ratelimit.average=5
- traefik.http.middlewares.api-ratelimit.ratelimit.burst=10
- traefik.http.middlewares.api-ratelimit.ratelimit.period=1s
# Middleware to ratelimit API
- traefik.http.routers.app-https.middlewares=api-ratelimit
environment:
### MongoDB
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_INITDB_HOST: ${MONGO_INITDB_HOST}
MONGO_INITDB_PORT: ${MONGO_INITDB_PORT}
MONGO_INITDB_AUTHENTICATION_DATABASE: ${MONGO_INITDB_AUTHENTICATION_DATABASE}
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
### server
SERVER_KEY: ${SERVER_KEY}
networks:
- traefik-public
- psidomaincheck-net
mongo-a:
image: mongo:latest
ports:
- "27017:27017"
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_AUTHENTICATION_DATABASE: ${MONGO_INITDB_AUTHENTICATION_DATABASE}
networks:
- psidomaincheck-net
hostname: mongo-a
volumes:
- ./seed_mongo_data.sh:/docker-entrypoint-initdb.d/seed_mongo_data.sh
- ./data/fixtures:/fixtures
- psidomaincheck_feed:/data/db
volumes:
psidomaincheck_feed:
networks:
traefik-public:
external: true
psidomaincheck-net:
external: false