-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
41 lines (41 loc) · 1.25 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
41 lines (41 loc) · 1.25 KB
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
version: "2.2"
# Define our services
services:
# This is our nodejs app built using the Dockerfile
ulearn-chat-ms:
# The name of our node app container
container_name: ulearn-chat-ms
# Restarts our node app whenever it fails
restart: always
# Builds the node app docker container from the local -
# Docker file we created
build:
context: .
dockerfile: Dockerfile
# Exposes the necessary ports that our node app uses
ports:
- "6663:6663"
# All the services our node app will link to -
# which in our case is only mongo
# You can other services such as a Redis
links:
# The name should be similar to the service you will build
- ulearn-chat-db
# Set the environment of the deploy
environment:
NODE_ENV: production
DB_PORT: 6662
# Set dependency relation
depends_on:
- ulearn-chat-db
# Our database service called mongo
ulearn-chat-db:
# The name of the database container, NOTE: it is similar to the name provided
container_name: ulearn-chat-db
# Builds a mongo image from the docker repository
image: mongo
# Change the port that Mongo uses
command: mongod --port 6662
# Exposes the ports that Mongo uses
expose:
- "6662"