Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐳 Dockerfile aktualisiert #675

Merged
merged 3 commits into from
May 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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