Skip to content

Commit

Permalink
Merge pull request #675 from gnmyt/updates/dockerfile
Browse files Browse the repository at this point in the history
🐳 Dockerfile aktualisiert
  • Loading branch information
gnmyt authored May 18, 2024
2 parents 242ad3b + 374dfd8 commit 1e8c0ec
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
FROM node:18-alpine
RUN apk add g++ make cmake python3 --no-cache

ENV NODE_ENV=production
FROM node:20-alpine AS build
RUN apk add g++ make cmake python3

WORKDIR /myspeed

COPY --chown=node:node ./client ./client
COPY --chown=node:node ./server ./server
COPY --chown=node:node ./package.json ./package.json
COPY ./client ./client
COPY ./server ./server
COPY ./package.json ./package.json

RUN npm install
RUN cd client && npm install --force
RUN npm run build
RUN mv /myspeed/client/build /myspeed
RUN rm -rf /myspeed/client
RUN mkdir -p /myspeed/data

RUN chown -R node:node /myspeed
FROM node:20-alpine

ENV NODE_ENV=production

WORKDIR /myspeed

USER node
COPY --from=build /myspeed/build /myspeed/build
COPY --from=build /myspeed/server /myspeed/server
COPY --from=build /myspeed/node_modules /myspeed/node_modules
COPY --from=build /myspeed/package.json /myspeed/package.json

VOLUME ["/myspeed/data"]

Expand Down

0 comments on commit 1e8c0ec

Please sign in to comment.