1 | # Used by docker-compose.yml to deploy the formio application
|
2 | # (When modified, you must include `--build` )
|
3 | # -----------------------------------------------------------
|
4 |
|
5 | # Use Node image, maintained by Docker:
|
6 | # hub.docker.com/r/_/node/
|
7 | FROM node:lts-alpine
|
8 | WORKDIR /app
|
9 |
|
10 | # "bcrypt" requires python/make/g++, all must be installed in alpine
|
11 | # (note: using pinned versions to ensure immutable build environment)
|
12 | RUN apk update && \
|
13 | apk upgrade && \
|
14 | apk add python=2.7.16-r1 && \
|
15 | apk add make=4.2.1-r2 && \
|
16 | apk add g++=8.3.0-r0
|
17 |
|
18 | # Using an alternative package install location
|
19 | # to allow overwriting the /app folder at runtime
|
20 | # stackoverflow.com/a/13021677
|
21 | ENV NPM_PACKAGES=/.npm-packages \
|
22 | PATH=$NPM_PACKAGES/bin:$PATH \
|
23 | NODE_PATH=$NPM_PACKAGES/lib/node_modules:$NODE_PATH
|
24 | RUN echo "prefix = $NPM_PACKAGES" >> ~/.npmrc
|
25 |
|
26 | # Include details of the required dependencies
|
27 | COPY ./package.json $NPM_PACKAGES/
|
28 | COPY ./package-lock.json $NPM_PACKAGES/
|
29 |
|
30 | # Use "Continuous Integration" to install as-is from package-lock.json
|
31 | RUN npm ci --prefix=$NPM_PACKAGES
|
32 |
|
33 | # Link in the global install because `require()` only looks for ./node_modules
|
34 | # WARNING: This is overwritten by volume-mount at runtime!
|
35 | # See docker-compose.yml for instructions
|
36 | RUN ln -sf $NPM_PACKAGES/node_modules node_modules
|
37 |
|
38 | # Set this to inspect more from the application. Examples:
|
39 | # DEBUG=formio:db (see index.js for more)
|
40 | # DEBUG=formio:*
|
41 | ENV DEBUG=""
|
42 |
|
43 | # This will initialize the application based on
|
44 | # some questions to the user (login email, password, etc.)
|
45 | ENTRYPOINT [ "node", "main" ]
|