Switch to alpine
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 43s
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 43s
This commit is contained in:
14
Dockerfile
14
Dockerfile
@ -1,15 +1,13 @@
|
|||||||
# base
|
# base
|
||||||
# ----
|
# ----
|
||||||
FROM node:20-bookworm-slim AS base
|
FROM node:lts-alpine AS base
|
||||||
|
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
# We tried to make the Dockerfile as lean as possible. In some cases, that means we excluded a dependency your project needs.
|
# We tried to make the Dockerfile as lean as possible. In some cases, that means we excluded a dependency your project needs.
|
||||||
# By far the most common is Python. If you're running into build errors because `python3` isn't available,
|
# By far the most common is Python. If you're running into build errors because `python3` isn't available,
|
||||||
# add `python3 make gcc \` before the `openssl \` line below and in other stages as necessary:
|
# add `python3 make gcc \` before the `openssl \` line below and in other stages as necessary:
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apk add openssl
|
||||||
openssl \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
@ -96,13 +94,11 @@ RUN yarn rw build web --no-prerender
|
|||||||
|
|
||||||
# api serve
|
# api serve
|
||||||
# ---------
|
# ---------
|
||||||
FROM node:20-bookworm-slim AS api_serve
|
FROM node:lts-alpine AS api_serve
|
||||||
|
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apk add openssl
|
||||||
openssl \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
@ -142,7 +138,7 @@ CMD [ "./api/dist/server.js" ]
|
|||||||
|
|
||||||
# web serve
|
# web serve
|
||||||
# ---------
|
# ---------
|
||||||
FROM node:20-bookworm-slim AS web_serve
|
FROM node:lts-alpine AS web_serve
|
||||||
|
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user