diff --git a/frontend/Dockerfile b/frontend/Dockerfile index ee4e14d..a5b17af 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,13 +4,13 @@ FROM node:latest as build WORKDIR /app # Copy package.json and package-lock.json to the working directory -COPY package*.json ./ +COPY package*.json ./ # Install dependencies RUN npm install # Copy the remaining application code to the working directory -COPY . . +COPY . . # Build the React app RUN npm run build @@ -18,6 +18,9 @@ RUN npm run build # Use Nginx to serve the built React app FROM nginx:latest +# Copy the custom nginx.conf file to Nginx configuration directory +COPY nginx.conf /etc/nginx/nginx.conf + # Copy the built React app from the previous stage to the Nginx directory COPY --from=build /app/build /usr/share/nginx/html diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..353faab --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + + server_name _; + + location / { + root /usr/share/nginx/html; + try_files $uri /index.html; + } +} \ No newline at end of file