chore: clean up dockerfile (#8)
This commit is contained in:
parent
3e23f40bd6
commit
8d59f85562
24
Dockerfile
24
Dockerfile
@ -1,23 +1,29 @@
|
|||||||
FROM node:20-bullseye-slim as base
|
FROM node:20-bullseye-slim as base
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y make g++ python3
|
FROM base as production_buildstage
|
||||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
|
||||||
|
|
||||||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
|
||||||
FROM base as production
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
USER node
|
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
COPY --chown=node:node . ./
|
COPY --chown=node:node . ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 8080
|
FROM base as production
|
||||||
|
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
USER node
|
||||||
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
COPY --from=production_buildstage /home/node/app/dist /home/node/app/dist
|
||||||
|
|
||||||
ENTRYPOINT ["npm", "run", "start:prod"]
|
ENTRYPOINT ["npm", "run", "start:prod"]
|
||||||
|
|
||||||
FROM base as development
|
FROM base as development
|
||||||
USER node
|
|
||||||
|
WORKDIR /home/node/app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user