mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-17 12:18:53 +02:00
35 lines
586 B
Docker
35 lines
586 B
Docker
FROM node:20-alpine
|
|
|
|
WORKDIR /home/node/app
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache python3 make g++
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p public/css/dist data public/uploads
|
|
|
|
# Install dependencies first (better layer caching)
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Build CSS
|
|
RUN npm run build:css
|
|
|
|
# Set correct permissions
|
|
RUN chown -R node:node .
|
|
|
|
# Switch to non-root user
|
|
USER node
|
|
|
|
# Set environment variables
|
|
ENV NODE_ENV=production \
|
|
PORT=2222
|
|
|
|
# Expose port
|
|
EXPOSE 2222
|
|
|
|
# Start the application
|
|
CMD ["npm", "start"] |