forked from formio/formio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (50 loc) · 1.69 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
# Allows us to start the stack without touching too much of our local system
#
# note: the application initialization will download/unpack/configure files
# in the local directory...
#
# ##### Usage:
# *0. Create a broken symlink: `ln -sf "/.npm-packages/node_modules/" node_modules`
# 1. Start the database: `docker-compose up -d mongo`
# 2. Start the application: `docker-compose run formio`
# [3]. Stop the database: `docker-compose down` (add --volumes to clear data)
# [4]. Remove lingering docker images: `docker-compose down -v --rmi all`
#
# *TODO: Step 0 is for the bcrypt binary compiled on alpine, which is required...
# but this step feels like an anti-pattern and a better approach should be found
version: '3.7'
services:
mongo:
image: mongo:4.1.5
restart: always
ports:
- 27017:27017
volumes:
- mdb-data:/data/db
# The application assumes passwordless access, which it will use to
# create its own users/databases
environment:
MONGO_INITDB_ROOT_USERNAME:
MONGO_INITDB_ROOT_PASSWORD:
formio:
build: ./
# The app will restart until Mongo is listening
restart: always
# (currently) Must use host to access database via localhost
network_mode: host
ports:
- 3001:3001
# The application wants to download things to the local directory
# TODO: really wish I could mount this as read-only
volumes:
- ./:/app:rw
environment:
DEBUG:
# DEBUG: formio:*
# The application will prompt us to answer some questions
# before the application will start...
# (maybe there is a config somewhere to automate it?)
stdin_open: true # -i
tty: true # -t
volumes:
mdb-data: