forked from juffalow/express-graphql-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
22 lines (15 loc) · 751 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM node:16-alpine AS build
USER node
RUN mkdir /home/node/express-graphql-example/ && chown -R node:node /home/node/express-graphql-example
WORKDIR /home/node/express-graphql-example
COPY --chown=node:node . .
RUN yarn install --frozen-lockfile && yarn build
FROM node:16-alpine
USER node
EXPOSE 3010
RUN mkdir /home/node/express-graphql-example/ && chown -R node:node /home/node/express-graphql-example
WORKDIR /home/node/express-graphql-example
COPY --chown=node:node --from=build /home/node/express-graphql-example/dist ./dist
COPY --chown=node:node --from=build /home/node/express-graphql-example/package.json /home/node/express-graphql-example/yarn.lock ./
RUN yarn install --frozen-lockfile --production
CMD [ "node", "dist/index.js" ]