diff --git a/docker-compose.yaml b/docker-compose.yaml index a44c0727..8d5a7902 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -35,7 +35,7 @@ services: - "80:80" - "443:443" volumes: - - ./web_app/static/:/app/static/ + - - ./certs/spotnet.xyz.chain.crt:/etc/nginx/spotnet.xyz.chain.crt:ro - ./certs/spotnet.xyz.key:/etc/nginx/spotnet.xyz.key:ro - ./spotnet.conf:/etc/nginx/conf.d/spotnet.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 9ad0a166..06d155d3 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,27 +1,9 @@ -# Stage 1: Build the react app -FROM node:18 AS build +FROM node:20-alpine as build -WORKDIR /usr/src/app +WORKDIR /app -# Copy package.json and package-lock.json to install dependencies -COPY package*.json ./ +RUN npm install yarn --global --force -# Install dependencies with legacy peer deps option -RUN npm install --legacy-peer-deps || true - -# Copy the rest of the application source code COPY . . -# Build the app (if there are build commands in the package.json) -RUN npm run build - -# Stage 2: Serve the built app using nginx -FROM nginx:alpine - -# Copy the built files from the previous stage to the nginx container -COPY --from=build /usr/src/app/build /usr/share/nginx/html - -# Expose the port Nginx will listen to -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +RUN yarn install && yarn build \ No newline at end of file