forked from sensebox/openSenseMap-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (22 loc) · 742 Bytes
/
Dockerfile
File metadata and controls
33 lines (22 loc) · 742 Bytes
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
FROM node:14.18-alpine as build
ENV NODE_ENV=production
RUN apk --no-cache --virtual .build add build-base python git
# taken from node:6-onbuild
#RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# copy in main package.json and yarn.lock
COPY package.json /usr/src/app/
COPY yarn.lock /usr/src/app/
# copy in workspace package.json files
COPY packages/api/package.json /usr/src/app/packages/api/
COPY packages/models/package.json /usr/src/app/packages/models/
RUN yarn install --pure-lockfile --production
COPY . /usr/src/app
RUN yarn create-version-file \
&& rm -rf .git .scripts
# Final stage
FROM node:14.18-alpine
ENV NODE_ENV=production
WORKDIR /usr/src/app
COPY --from=build /usr/src/app /usr/src/app
CMD [ "yarn", "start" ]