UNPKG

1.48 kBYAMLView Raw
1# Allows us to start the stack without touching too much of our local system
2#
3# note: the application initialization will download/unpack/configure files
4# in the local directory...
5#
6# ##### Usage:
7# *0. Create a broken symlink: `ln -sf "/.npm-packages/node_modules/" node_modules`
8# 1. Start the database: `docker-compose up -d mongo`
9# 2. Start the application: `docker-compose run formio`
10# [3]. Stop the database: `docker-compose down` (add --volumes to clear data)
11# [4]. Remove lingering docker images: `docker-compose down -v --rmi all`
12#
13# *TODO: Step 0 is for the bcrypt binary compiled on alpine, which is required...
14# but this step feels like an anti-pattern and a better approach should be found
15
16version: '3.7'
17services:
18 mongo:
19 image: mongo:4.1
20 restart: always
21 volumes:
22 - mdb-data:/data/db
23 environment:
24 MONGO_INITDB_ROOT_USERNAME:
25 MONGO_INITDB_ROOT_PASSWORD:
26
27 formio:
28 build: ./
29 # The app will restart until Mongo is listening
30 restart: always
31 links:
32 - mongo
33 ports:
34 - "3001:3001"
35 # The application wants to download things to the local directory
36 # TODO: really wish I could mount this as read-only
37 volumes:
38 - ./:/app:rw
39 environment:
40 DEBUG: formio:*
41 NODE_CONFIG: '{"mongo": "mongodb://mongo:27017/formio"}'
42 ROOT_EMAIL: admin@example.com
43 ROOT_PASSWORD: CHANGEME
44 stdin_open: true # -i
45 tty: true # -t
46
47volumes:
48 mdb-data: