Restore original Dockerfile, fix CI stage
This commit is contained in:
parent
569559a8fd
commit
7ef52805ca
|
@ -58,7 +58,6 @@ jobs:
|
|||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
target: release
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||
|
|
19
Dockerfile
19
Dockerfile
|
@ -1,20 +1,27 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM node:20-alpine
|
||||
|
||||
# Use production node environment by default.
|
||||
ENV NODE_ENV production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci --omit=dev
|
||||
# Download dependencies as a separate step to take advantage of Docker's caching.
|
||||
# Leverage a cache mount to /root/.npm to speed up subsequent builds.
|
||||
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
|
||||
# into this layer.
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
npm ci --omit=dev
|
||||
|
||||
# Run the application as a non-root user.
|
||||
USER root
|
||||
|
||||
# Copy the rest of the source files into the image.
|
||||
COPY . .
|
||||
|
||||
# Run the application as a root user.
|
||||
USER root
|
||||
|
||||
# Expose the port that the application listens on.
|
||||
EXPOSE 8000
|
||||
|
||||
|
|
Loading…
Reference in New Issue