-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 969 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (29 loc) · 969 Bytes
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
39
40
# --- Build stage: install dependencies ---
FROM node:24-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --no-fund --omit dev
# --- Final stage: minimal runtime image ---
FROM node:24-slim
LABEL org.opencontainers.image.authors="Peter Müller <peter@crycode.de> (https://crycode.de/)"
ENV USER=node \
PORT=8080 \
WORKDIR=/app \
UPLOAD_DIR="/upload" \
UPLOAD_TMP_DIR="/upload" \
DISABLE_AUTO_PORT="1" \
ENABLE_FOLDER_CREATION="" \
INDEX_FILE="" \
MAX_FILE_SIZE=200 \
PATH_REGEXP="" \
TOKEN=""
EXPOSE ${PORT}
WORKDIR ${WORKDIR}
# copy only runtime files
COPY --from=builder /app/node_modules ./node_modules
COPY http-server-upload.js package.json README.md ./
RUN mkdir -p ${UPLOAD_DIR} ${UPLOAD_TMP_DIR} && \
chown -R ${USER} ${WORKDIR} ${UPLOAD_DIR} ${UPLOAD_TMP_DIR} && \
chmod 700 ${WORKDIR} ${UPLOAD_DIR} ${UPLOAD_TMP_DIR}
USER ${USER}
CMD [ "node", "http-server-upload.js" ]