⬆️ Bumped to node17
This commit is contained in:
+6
-4
@@ -1,6 +1,6 @@
|
||||
### Build Step
|
||||
# pull the Node.js Docker image
|
||||
FROM node:16 as builder
|
||||
FROM node:17.8-bullseye as builder
|
||||
# ENV API_URL=http://api:80
|
||||
ENV API_URL=https://mawoka.eu
|
||||
ENV REDIS_URL=CHANGE_ME
|
||||
@@ -11,9 +11,10 @@ WORKDIR /usr/src/app
|
||||
|
||||
# copy the package.json files from local machine to the workdir in container
|
||||
COPY package*.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# run npm install in our local machine
|
||||
RUN apt update && apt install -y curl && curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm && pnpm i
|
||||
RUN corepack enable && corepack prepare pnpm@7.0.0-rc.2 --activate && pnpm i
|
||||
|
||||
# copy the generated modules and all other files to the container
|
||||
COPY . .
|
||||
@@ -23,14 +24,15 @@ RUN pnpm run build
|
||||
|
||||
### Serve Step
|
||||
# pull the Node.js Docker image
|
||||
FROM node:16
|
||||
FROM node:17.8-bullseye-slim
|
||||
|
||||
# change working directory
|
||||
WORKDIR /app
|
||||
RUN apt update && apt install -y curl && curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm && apt purge curl -y && apt autoremove -y
|
||||
RUN corepack enable && corepack prepare pnpm@7.0.0-rc.2 --activate && pnpm i
|
||||
# copy files from previous step
|
||||
COPY --from=builder /usr/src/app/build .
|
||||
COPY --from=builder /usr/src/app/package.json .
|
||||
COPY --from=builder /usr/src/app/pnpm-lock.yaml .
|
||||
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||
|
||||
# our app is running on port 3000 within the container, so need to expose it
|
||||
|
||||
Reference in New Issue
Block a user