forked from shift-org/shift-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
105 lines (98 loc) · 3.22 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: "2"
volumes:
# used by the db container to store mysql content
db: {}
# used by the node container to cache node_modules
modules: {}
services:
nginx:
image: nginx:1.26.2
restart: always
volumes:
# DEV SITE:
- ./site/public/:/var/www/site/
# EVENT IMAGES:
- "${EVENTIMAGES}:/opt/backend/eventimages"
# NGINX CONF:
- ./services/nginx/:/opt/nginx/
- ./services/nginx/conf.d:/etc/nginx/conf.d
- ${LETSENCRYPT_WEBROOT}:/tmp/letsencrypt-auto
links:
# lets shift.conf reference node ( ex. http://node:3080 )
- node
ports:
- "${NGINX_HTTPS_PORT}:443"
- "${NGINX_HTTP_PORT}:80"
entrypoint: /opt/nginx/entrypoint.sh
command: ["nginx", "-g", "daemon off;"]
db:
restart: always
image: mysql:8.4
command: mysqld --mysql-native-password=ON
environment:
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_HOST
volumes:
- db:/var/lib/mysql/
ports:
- 3306
hugo:
# note: this container is only needed for local development.
# for production, netlify serves the hugo content instead.
# see also: ./shift watch ( sub_watch() )
image: floryn90/hugo:0.128.2-busybox
volumes:
- ./site/:/src/
- ./site/public/:/output/
command: "--logLevel debug"
node:
restart: always
image: node:20.18.0-slim
# use the local logging driver for log storage and rotation
# WARNING: doesnt work on production, reports:
# no logs are available with the 'local' log driver
# https://docs.docker.com/config/containers/logging/local/
# logging:
# driver: local
links:
- db
environment:
# these pull from the host environment
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_HOST
- SHIFT_DOMAIN # used for generating sharable links
- NGINX_HTTPS_PORT # used for generating sharable links
- SHIFT_IMAGE_DIR # event images
- SMTP_HOST
- SMTP_USER
- SMTP_PASS
# by default the node image will run "node"
# https://github.com/nodejs/docker-node/blob/main/docker-entrypoint.sh
# override to run npm start; which auto installs from package-lock.json
command: npm start
working_dir: /shift
volumes:
# map the shift node code and package files;
# and attach to the volume for its modules.
# remaps "package-lock" to "npm-shrinkwrap"
# to ensure "npm i" uses a fixed set of dependencies.
- ./app:/shift/app/
- ./tools:/shift/tools/
- ./package.json:/shift/package.json
- ./package-lock.json:/shift/npm-shrinkwrap.json
- modules:/shift/node_modules/
# provide access to images:
# the left-hand side is the host directory
# the right-hand side has to be SHIFT_IMAGE_DIR
# todo: change the host side to a named volume?
# fix: can the rhs here use the environment var?
- ./backend/eventimages/:/opt/backend/eventimages/
# DEACTIVATED: access for email log:
# email logging disabled has been disabled in emailer.js
# console logging being used instead re: "./shift logs node"
# - ./services/node/:/opt/node/