Updated dockerfile for new file structure

This commit is contained in:
Karmaa
2025-02-09 01:55:36 -06:00
parent e058892118
commit d799b8fe42

View File

@@ -1,30 +1,30 @@
# Build frontend # Build frontend
FROM node:18-alpine AS frontend-build FROM node:18-alpine AS frontend-build
WORKDIR /app WORKDIR /app
COPY frontend/package*.json ./frontend/ COPY package*.json ./
RUN npm --prefix frontend install RUN npm install
COPY frontend/ ./frontend/ COPY ./ ./
RUN npm --prefix frontend run build RUN npm run build
# Build backend # Build backend
FROM node:18-alpine AS backend-build FROM node:18-alpine AS backend-build
WORKDIR /backend WORKDIR /backend
COPY backend/package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
COPY backend/ . COPY src/backend src/backend
# Configure nginx # Configure nginx
FROM nginx:alpine FROM nginx:alpine
RUN apk add --no-cache nodejs npm RUN apk add --no-cache nodejs npm
COPY docker/nginx.conf /etc/nginx/nginx.conf COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html COPY --from=frontend-build /app/dist /usr/share/nginx/html
COPY --from=backend-build src/backend/ /src/backend/ COPY --from=backend-build /backend /backend
COPY --from=backend-build src/backend/entrypoint.sh /src/backend/entrypoint.sh COPY --from=backend-build /backend/entrypoint.sh /backend/entrypoint.sh
# Configure start-up # Configure start-up
RUN chmod +x /backend/entrypoint.sh RUN chmod +x /backend/entrypoint.sh
ENTRYPOINT ["/src/backend/entrypoint.sh"] ENTRYPOINT ["/backend/entrypoint.sh"]
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081 EXPOSE 8081