-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose_ref.yml
98 lines (92 loc) · 2.46 KB
/
docker-compose_ref.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
version: '3.7'
services:
api:
container_name: api
image: node:16.17.1-alpine
working_dir: /usr/src/app
ports:
- '3000:3000'
command: >
/bin/sh -c "
echo Waiting for mongodb service start...;
while ! nc -z mongo 27017;
do
sleep 1;
done;
npm run dev
"
init: true
volumes:
- .:/usr/src/app
depends_on:
- mongo
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.api.rule=Host(`fastify.localhost`) && PathPrefix(`/api/v1`)'
- 'traefik.http.routers.api.entrypoints=http'
mongo:
container_name: mongo
image: 'bitnami/mongodb:4.4'
restart: always
ports:
- '27017:27017'
volumes:
- 'mongodb_data:/bitnami/mongodb'
environment:
MONGODB_USERNAME: ${MONGODB_USERNAME}
MONGODB_PASSWORD: ${MONGODB_PASSWORD}
MONGODB_DATABASE: ${MONGODB_DATABASE}
MONGODB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.mongo.entrypoints=http'
postgresql:
container_name: postgresql
image: 'bitnami/postgresql:9.6'
restart: always
ports:
- '5432:5432'
volumes:
- postgresql_data:/bitnami/postgresql
environment:
POSTGRESQL_USER: ${POSTGRESQL_USER}
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.postgresql.entrypoints=http'
sonarqube:
container_name: sonarqube
image: bitnami/sonarqube:latest
depends_on:
- postgresql
ports:
- '9000:9000'
volumes:
- sonarqube_data:/bitnami
environment:
SONARQUBE_DATABASE_USER: ${POSTGRESQL_USER}
SONARQUBE_DATABASE_NAME: ${POSTGRESQL_DATABASE}
SONARQUBE_DATABASE_PASSWORD: ${POSTGRESQL_PASSWORD}
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.sonarqube.rule=Host(`sonarqube.localhost`)'
- 'traefik.http.routers.sonarqube.entrypoints=http'
traefik:
container_name: traefik
image: traefik:v2.5.3
command: --api.insecure=true --providers.docker --log.level=debug --accesslog=true
ports:
- '80:80'
- '8080:8080'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
labels:
- 'traefik.http.routers.traefik.entrypoints=http'
volumes:
postgresql_data:
driver: local
sonarqube_data:
driver: local
mongodb_data:
driver: local