chore: setup docker, gitea actions pipeline and docs
Some checks failed
Build and Deploy / build-and-push (push) Failing after 3m18s

This commit is contained in:
Cauê Faleiros
2026-02-19 14:25:42 -03:00
parent a5fe089e2e
commit 25384beaa7
5 changed files with 167 additions and 0 deletions

47
Dockerfile Normal file
View File

@@ -0,0 +1,47 @@
# Stage 1: Build the React application
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package.json and package-lock.json first to leverage Docker cache
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application code
COPY . .
# Accept the API_KEY as a build argument
ARG API_KEY
ENV API_KEY=$API_KEY
# Build the application
RUN npm run build
# Stage 2: Serve the application with Node.js
FROM node:20-alpine AS runner
WORKDIR /app
# Set environment to production
ENV NODE_ENV=production
ENV PORT=8080
# Copy package.json and package-lock.json for production dependencies
COPY package*.json ./
# Install only production dependencies
RUN npm ci --only=production
# Copy the built assets from the builder stage
COPY --from=builder /app/dist ./dist
# Copy the server script
COPY server.js .
# Expose the port the app runs on
EXPOSE 8080
# Start the server
CMD ["node", "server.js"]