plssssss
Some checks failed
Deploy Encrypted Todo App / build-and-push (push) Has been cancelled

This commit is contained in:
2025-06-16 09:24:40 -06:00
parent d71062cf13
commit b61f664825
3 changed files with 188 additions and 147 deletions

View File

@ -1,38 +1,34 @@
FROM node:24-alpine
FROM node:20-alpine
# Install pnpm
RUN npm install -g pnpm
# Set the working directory in the container
WORKDIR /app
# Copy package.json and pnpm-lock.yaml (if available)
COPY package*.json pnpm-lock.yaml* ./
# Install pnpm globally
RUN npm install -g pnpm
# Copy dependency files first for better caching
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile --prod
# Copy the rest of the application code
COPY . .
# Copy application files
COPY server.js todo-service.js signal-crypto.js ./
COPY public/ ./public/
COPY .env* ./
# Create a directory for the SQLite database
RUN mkdir -p /app/data
# Create data directory and set permissions
RUN mkdir -p /app/data && chown -R node:node /app
# Set environment variables
ENV NODE_ENV=production
ENV SQLITE_DB_PATH=/app/data/db.db
ENV PORT=3000
# Expose the port the app runs on
# Expose port
EXPOSE 3000
# Create a non-root user to run the application
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nodejs -u 1001
# Switch to non-root user
USER node
# Change ownership of the app directory to the nodejs user
RUN chown -R nodejs:nodejs /app
USER nodejs
# Command to run the application
CMD ["pnpm", "start"]
# Start application
CMD ["node", "server.js"]