Files
timeline/Dockerfile
licsber cf74607dbf
Some checks failed
Build and Push Docker Image / buildx (push) Has been cancelled
fix: docker permission.
2025-11-11 15:18:01 +08:00

29 lines
563 B
Docker

FROM node:25-alpine AS base
WORKDIR /app
# Dependencies stage
FROM base AS deps
COPY package*.json ./
RUN npm install --production
# Production stage
FROM base AS production
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Create directory for database with proper permissions
RUN mkdir -p /app/data && chown -R 1001:1001 /app/data
EXPOSE 3000
# Create a non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
USER nextjs
# Set environment variable for database path
ENV DB_PATH=/app/data/data.db
CMD ["node", "server.js"]