Skip to content

Commit

Permalink
fix: router nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
btwlouis committed Dec 29, 2024
1 parent 01ae487 commit cdd05e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ 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

# 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

Expand Down
10 changes: 10 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 80;

server_name _;

location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}

0 comments on commit cdd05e5

Please sign in to comment.