Skip to content

Commit

Permalink
Merge pull request #76 from cheehongw/frontend-nginx
Browse files Browse the repository at this point in the history
Fix nginx deployment
  • Loading branch information
Eclipse-Dominator authored Nov 15, 2023
2 parents 4fb3fcd + 13bed87 commit 21a180a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN npm run build

# Serve stage
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
15 changes: 15 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;

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

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
2 changes: 1 addition & 1 deletion frontend/src/reducers/authSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const dummyAdmin: User = {
};

const initialState: AuthState = {
user: dummyUser // null
user: null
}

const userSlice = createSlice({
Expand Down

0 comments on commit 21a180a

Please sign in to comment.