feat: Add Docker containerization, production serving, and Gitea CI/CD workflow.
Some checks failed
Build and Deploy / build (push) Failing after 2m44s
Some checks failed
Build and Deploy / build (push) Failing after 2m44s
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
# Use Node.js LTS (Alpine for smaller size)
|
||||
FROM node:20-alpine
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package definition first to cache dependencies
|
||||
COPY src/package.json src/package-lock.json ./
|
||||
|
||||
# Install dependencies
|
||||
# Using npm install instead of ci to ensure updated package.json is respected
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the source code
|
||||
COPY src/ ./
|
||||
|
||||
# Build the frontend (Production build)
|
||||
RUN npm run build
|
||||
|
||||
# Remove development dependencies to keep image small
|
||||
RUN npm prune --production
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the application
|
||||
CMD ["npm", "start"]
|
||||
Reference in New Issue
Block a user