⬆️ Bumped to node17
This commit is contained in:
+6
-4
@@ -1,6 +1,6 @@
|
|||||||
### Build Step
|
### Build Step
|
||||||
# pull the Node.js Docker image
|
# 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=http://api:80
|
||||||
ENV API_URL=https://mawoka.eu
|
ENV API_URL=https://mawoka.eu
|
||||||
ENV REDIS_URL=CHANGE_ME
|
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 the package.json files from local machine to the workdir in container
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
COPY pnpm-lock.yaml ./
|
||||||
|
|
||||||
# run npm install in our local machine
|
# 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 the generated modules and all other files to the container
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -23,14 +24,15 @@ RUN pnpm run build
|
|||||||
|
|
||||||
### Serve Step
|
### Serve Step
|
||||||
# pull the Node.js Docker image
|
# pull the Node.js Docker image
|
||||||
FROM node:16
|
FROM node:17.8-bullseye-slim
|
||||||
|
|
||||||
# change working directory
|
# change working directory
|
||||||
WORKDIR /app
|
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 files from previous step
|
||||||
COPY --from=builder /usr/src/app/build .
|
COPY --from=builder /usr/src/app/build .
|
||||||
COPY --from=builder /usr/src/app/package.json .
|
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
|
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
|
# our app is running on port 3000 within the container, so need to expose it
|
||||||
|
|||||||
Reference in New Issue
Block a user