-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (34 loc) · 1.51 KB
/
Dockerfile
File metadata and controls
45 lines (34 loc) · 1.51 KB
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
FROM instructure/node-passenger:16
ARG prunedev=true
ENV APP_HOME "/usr/src/app"
USER root
# remove Yarn apt source - GPG key expired and Yarn is already installed in base image
RUN rm -f /etc/apt/sources.list.d/yarn.list
RUN apt-get update \
&& apt-get install -y -o Acquire::Retries=5 -o Acquire::http::Timeout=30 \
redis-server \
libpython3.8 \
python3 \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV NODE_ENV production
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${APP_HOME}/node_modules/.bin
ADD package.json ${APP_HOME}/package.json
ADD package-lock.json ${APP_HOME}/package-lock.json
ADD format_coverage.rb ${APP_HOME}/format_coverage.rb
ADD .babelrc ${APP_HOME}/.babelrc
ADD .eslintignore ${APP_HOME}/.eslintignore
ADD .eslintrc ${APP_HOME}/.eslintrc
ADD ./server ${APP_HOME}/server
ADD ./ui ${APP_HOME}/ui
ADD ./client ${APP_HOME}/client
RUN mkdir -p localdata coverage log tmp && chown -R docker:docker ${APP_HOME}
USER docker
# to expose the application to passenger
RUN ln -s ${APP_HOME}/ui/public ${APP_HOME}/public
RUN ln -s ${APP_HOME}/server/index.js ${APP_HOME}/app.js
RUN NODE_ENV=dev npm ci --legacy-peer-deps --python=/usr/bin/python3 \
&& NODE_ENV=production node_modules/.bin/webpack -p --config client/webpack.config.js \
&& NODE_ENV=production node_modules/.bin/webpack -p --config ui/webpack.config.js \
&& if [ "$prunedev" = "true" ]; then npm prune --legacy-peer-deps --production; fi