-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
32 lines (32 loc) · 1 KB
/
docker-compose.yml
File metadata and controls
32 lines (32 loc) · 1 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
# Defines our composer file version
version: "2.2"
# Define our services
services:
# This is our nodejs app built using the Dockerfile
app:
# The name of our node app container
container_name: docker_nodejs_app
# Restarts our node app whenever it fails
restart: always
# Builds the node app docker container from the local -
# Docker file we created
build: .
# Exposes the necessary ports that our node app uses
ports:
- "3000:3000"
# 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
- mongo
# Our database service called mongo
mongo:
# The name of the database container, NOTE: it is similar to the name provided
# in the links value
container_name: mongo
# Builds a mongo image from the docker repository
image: mongo
# Exposes the ports that mongo uses
ports:
- "27017:27017"