mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-25 12:19:10 +00:00
refresh dockerfile (it's smoller and faster now!)
This commit is contained in:
parent
e03f6810da
commit
47938dbb3a
1 changed files with 8 additions and 13 deletions
21
Dockerfile
21
Dockerfile
|
@ -1,18 +1,13 @@
|
|||
FROM node:10 AS builder
|
||||
# ENV NODE_ENV production
|
||||
COPY ./UI /src/UI
|
||||
RUN cd /src/UI && yarn && yarn build
|
||||
|
||||
COPY ./Server /src/Server
|
||||
RUN cd /src/Server && yarn
|
||||
|
||||
RUN cp -r /src/UI/build /src/Server/public
|
||||
|
||||
WORKDIR /src
|
||||
COPY . /src
|
||||
# we double yarn here to strip off dev-only packages that are needed at build time.
|
||||
RUN yarn --frozen-lockfile &&\
|
||||
yarn build &&\
|
||||
yarn --prod --frozen-lockfile
|
||||
|
||||
FROM mhart/alpine-node:10
|
||||
ENV NODE_ENV production
|
||||
WORKDIR /dist
|
||||
EXPOSE 6769
|
||||
RUN npm i -g pm2
|
||||
COPY --from=builder /src/Server /dist
|
||||
CMD pm2-docker index.js
|
||||
COPY --from=builder /src /dist
|
||||
CMD node index.js
|
||||
|
|
Loading…
Add table
Reference in a new issue