forked from Koodikukkaro/Kendo-tournament-app
-
Notifications
You must be signed in to change notification settings - Fork 2
/
compose.yaml
87 lines (77 loc) · 2.18 KB
/
compose.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# start backend: `docker-compose up --build`
# (--force-recreate)
# reference:
# https://docs.docker.com/compose/compose-file/compose-file-v3/
version: "3"
services:
frontend:
# $USERNAME/$IMAGENAME:$TAG
image: koodikukkaro/frontend/v1
container_name: frontend
depends_on:
backend:
condition: service_healthy
build:
dockerfile: Dockerfile
context: ./frontend
ports:
#- "443:443"
#- "80:80"
# only for development, totally unnecessary:
- "80:3000"
# https://docs.docker.com/compose/networking/
networks:
- frontend
backend:
image: koodikukkaro/backend-server/v1
container_name: backend-server
depends_on:
database:
condition: service_healthy
build:
dockerfile: Dockerfile
context: ./backend/server
# Map the port 8080 of the container to the port 12345 of the host
# Container port has been exposed in the node:tag Docker Hub Dockerfile.
ports:
#- "443:8080"
- "12345:8080"
networks:
- frontend
- backend
# docker compose exec database <command>
# <command>: bash | mongosh
# mongosh: help
# use <db>
# db.<cltn>.find().pretty()
database:
# https://hub.docker.com/_/mongo/
image: koodikukkaro/database/v1
container_name: database
build:
dockerfile: Dockerfile
context: ./backend/database
restart: unless-stopped
# Port mapping from container to host ONLY for debugging purposes.
# Must be commented out. Format: HOST:CONTAINER
#ports:
#- "27017:27017"
# "MongoDB server in the image listens on the standard MongoDB port, 27017"
expose:
- 27017
# "/data/db inside the container, where MongoDB by default will write
# its data files"
volumes:
- koodikukkaro_volume:/data/db
networks:
- backend
networks:
frontend:
backend:
# Documentation: https://docs.docker.com/storage/volumes/
# Look at the database image's Dockerfile in Docker Hub to see
# which directory it uses to store data.
# "if you want to reuse a volume across multiple services,
# then define a named volume in" this "top-level volumes key"
volumes:
koodikukkaro_volume: