-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (34 loc) · 882 Bytes
/
docker-compose.yml
File metadata and controls
35 lines (34 loc) · 882 Bytes
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
# Docker Compose file Reference (https://docs.docker.com/compose/compose-file/)
version: "3.1"
services:
mongodb:
image: mongo:latest
container_name: mongo-walmart
hostname: mongo-walmart-db
user: root
ports:
- 27017:27018
networks:
appnet:
aliases:
- dbserver
# App Service
app:
container_name: go-walmart
# Configuration for building the docker image for the service
build:
context: . # Use an image built from the specified dockerfile in the current directory.
dockerfile: Dockerfile
hostname: go-walmart-service
ports:
- "8080:8080" # Forward the exposed port 8080 on the container to port 8080 on the host machine
environment:
- DB_HOST=dbserver
- DB_PORT=27017
networks:
- appnet
depends_on:
- mongodb
networks:
appnet:
driver: bridge