forked from TerriaJS/TerriaMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (30 loc) · 981 Bytes
/
Dockerfile
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
# build container
FROM node:14 as build
USER node
COPY --chown=node:node . /app
WORKDIR /app
ENV NODE_OPTIONS="--max_old_space_size=8192"
RUN yarn install
# get the build argument that has the version
ARG APP_VERSION=$(APP_VERSION)
RUN echo "APP_VERSION=${APP_VERSION}" > ".env"
# install the package patches
RUN npm run postinstall
# create the release
RUN yarn gulp release
# deploy container
FROM node:14-slim as deploy
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y gdal-bin
USER node
WORKDIR /app
COPY --from=build /app/wwwroot wwwroot
COPY --from=build /app/node_modules node_modules
COPY --from=build /app/lib lib
COPY --from=build /app/devserverconfig.json serverconfig.json
COPY --from=build /app/index.js index.js
COPY --from=build /app/package.json package.json
COPY --from=build /app/version.js version.js
EXPOSE 3001
ENV NODE_ENV=production
CMD [ "node", "./node_modules/terriajs-server/lib/app.js", "--config-file", "serverconfig.json" ]