-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (29 loc) · 953 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Stage 1: Build the application
FROM node:22-alpine AS builder
WORKDIR /app
RUN mkdir -p /app/data && chown node:node /app/data
COPY package*.json ./
RUN npm install
COPY . .
RUN npm ci
RUN npm run build
# Stage 2: Production image
FROM node:22-alpine
# Delete default node user
RUN deluser --remove-home node
RUN apk add --no-cache su-exec curl
WORKDIR /app
# Create data directory
COPY ./scripts/docker/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY --from=builder /app/build ./build
COPY package*.json ./
RUN npm install --omit=dev
COPY --from=builder /app/static ./static
EXPOSE 3000
LABEL org.opencontainers.image.authors="kmendell"
LABEL org.opencontainers.image.description="A Simple and Modern Docker Registry UI for use with Distribution/Registry"
# Add volume for persistent data
VOLUME ["/app/data"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["node", "build"]