-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
49 lines (44 loc) · 1.34 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
version: "3.8"
x-var: &DB_NAME database
services:
*DB_NAME:
image: mongo:4
container_name: *DB_NAME
ports:
- $MONGO_PORT:27017
environment:
MONGO_DATABASE_USERNAME: $MONGO_DATABASE_USERNAME
MONGO_DATABASE_PASSWORD: $MONGO_DATABASE_PASSWORD
MONGO_INITDB_DATABASE: $MONGO_INITDB_DATABASE
MONGO_INITDB_ROOT_USERNAME: $MONGO_INITDB_ROOT_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $MONGO_INITDB_ROOT_PASSWORD
volumes:
- ./init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh
- mongodb_data_container:/data/db
mongo-express:
image: "mongo-express"
container_name: mongo-express
ports:
- "8081:8081"
depends_on:
- *DB_NAME
environment:
ME_CONFIG_MONGODB_SERVER: *DB_NAME
ME_CONFIG_MONGODB_AUTH_DATABASE: $MONGO_INITDB_DATABASE
ME_CONFIG_MONGODB_AUTH_USERNAME: $MONGO_DATABASE_USERNAME
ME_CONFIG_MONGODB_AUTH_PASSWORD: $MONGO_DATABASE_PASSWORD
ME_CONFIG_BASICAUTH_USERNAME: $ME_CONFIG_BASICAUTH_USERNAME
ME_CONFIG_BASICAUTH_PASSWORD: $ME_CONFIG_BASICAUTH_PASSWORD
ME_CONFIG_MONGODB_ENABLE_ADMIN: "false"
server:
container_name: server
build: .
env_file: ".env"
environment:
DB_HOSTNAME: *DB_NAME
depends_on:
- *DB_NAME
ports:
- $SERVER_PORT:$SERVER_PORT
volumes:
mongodb_data_container: