Added ARM support

This commit is contained in:
Karmaa
2025-02-21 23:59:40 -06:00
parent a6b03aa792
commit e42c8c9788
5 changed files with 57 additions and 39 deletions

View File

@@ -1,32 +1,30 @@
# Build everything in one stage
FROM node:18-alpine
# Use Node.js base image for building frontend
FROM --platform=$BUILDPLATFORM node:18-alpine AS builder
# Install nginx and dependencies
RUN apk add --no-cache nginx npm
# Set working directory
# Install dependencies
RUN apk add --no-cache npm
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm install
# Copy the entire project (frontend and backend)
# Copy project files and build frontend
COPY ./ ./
# Build the frontend
RUN npm run build
# Configure nginx
COPY docker/nginx.conf /etc/nginx/nginx.conf
# Final stage with nginx
FROM --platform=$TARGETPLATFORM nginx:alpine
# Copy built frontend to nginx's web directory
COPY ./dist /usr/share/nginx/html
# Copy built frontend from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx config
COPY docker/nginx.conf /etc/nginx/nginx.conf
# Expose necessary ports
EXPOSE 8080
EXPOSE 8081
# Use entrypoint.sh to run both the backend and nginx
# Use entrypoint.sh to start backend and nginx
COPY --from=builder /app/src/backend/entrypoint.sh /app/src/backend/entrypoint.sh
RUN chmod +x /app/src/backend/entrypoint.sh
ENTRYPOINT ["/app/src/backend/entrypoint.sh"]