-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
executable file
·53 lines (51 loc) · 1.63 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
version: "3"
services:
# Mongo container to save the social networks data
mongo:
image: mongo
container_name: mongodb_socialnetworks
restart: unless-stopped
ports:
- "27018:27017"
# File in which there are the environmental variables
env_file:
- .env
# Credentials to init the database
environment:
- MONGO_INITDB_DATABASE=${MONGO_DB}
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PSWD}
volumes:
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro # Creates the database and the user
- ./mongo-socialnetworks:/data/db # Persistent data to not lose them even if the container is deleted
# Postgres container to save the data which have been analyzed
postgres:
image: postgres:alpine
container_name: postgresdb_socialnetworks
restart: unless-stopped
ports:
- "5432:5432"
env_file:
- .env
# Credentials to init the database and create the SQL schema
environment:
- POSTGRES_USER=${DEFAULT_POSTGRE_USER}
- POSTGRES_PASSWORD=${DEFAULT_POSTGRE_PSWD}
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql # SQL schema to create
- ./postgres-socialnetworks:/var/lib/postgresql/data # Persistent data to not lose them even if the container is deleted
# Dash container to deploy the platform
platform:
build: .
container_name: platform
depends_on:
- mongo
- postgres
restart: unless-stopped
ports:
- "8002:8002"
env_file:
- .env
volumes:
postgres-socialnetwork:
mongo-socialnetworks: