-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (51 loc) · 2.05 KB
/
Dockerfile
File metadata and controls
69 lines (51 loc) · 2.05 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Build stage with shared dependencies
FROM node:22-alpine@sha256:8ea2348b068a9544dae7317b4f3aafcdc032df1647bb7d768a05a5cad1a7683f AS base
WORKDIR /app
COPY package*.json ./
RUN npm ci
# Build client and server
FROM base AS builder
WORKDIR /app
COPY . .
RUN npm run build
# Production stage
FROM node:22-alpine@sha256:8ea2348b068a9544dae7317b4f3aafcdc032df1647bb7d768a05a5cad1a7683f AS production
WORKDIR /app
# Set default environment variables
ENV SQLITE_DB_PATH=/app/data/sqlite.db
ENV NODE_ENV=production
ENV PORT=5000
ENV PUID=1000
ENV PGID=1000
# Install su-exec (for privilege dropping) and shadow (for usermod/groupmod)
RUN apk add --no-cache su-exec shadow
# Reuse node_modules from base and prune dev dependencies (avoids a second npm ci)
COPY --from=base /app/node_modules ./node_modules
COPY package*.json ./
RUN npm prune --omit=dev
# Copy necessary files from build stage
COPY --from=builder /app/dist ./dist
# Copy drizzle configuration and migrations for production
COPY --from=builder /app/drizzle.config.ts ./
COPY --from=builder /app/migrations ./migrations
COPY --from=builder /app/shared ./shared
COPY --from=builder /app/scripts ./scripts
# Copy configuration files...
COPY --from=builder /app/package.json ./
# Create user, group, data directory, and set ownership
RUN addgroup questarr && \
adduser -G questarr -s /bin/sh -D questarr && \
mkdir -p /app/data && \
chown -R questarr:questarr /app
# Copy and set up entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 5000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["npm", "run", "start"]
LABEL org.opencontainers.image.title="Questarr"
LABEL org.opencontainers.image.description="A video game management application inspired by the -Arr apps. Track and organize your video game collection with automated discovery and download management."
LABEL org.opencontainers.image.authors="Doezer"
LABEL org.opencontainers.image.source="https://github.com/Doezer/questarr"
LABEL org.opencontainers.image.licenses="GPL-3.0-or-later"
LABEL org.opencontainers.image.version="1.3.1"