Skip to content
Snippets Groups Projects
Commit f6c859f9 authored by lcross2002's avatar lcross2002
Browse files

client using nginx

parent 9a452889
No related branches found
No related tags found
No related merge requests found
FROM node:18-alpine
FROM node:18-alpine AS build
WORKDIR /app
COPY package.json .
COPY package.json package-lock.json ./
RUN npm install
......@@ -10,6 +10,12 @@ COPY . .
RUN npm run build
EXPOSE 8080
FROM nginx:alpine
CMD [ "npm", "run", "preview" ]
\ No newline at end of file
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 4200
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
# nginx.conf
events {}
http {
server {
listen 4200;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
types {
text/html html;
application/javascript js;
text/css css;
image/png png;
image/jpeg jpg;
}
location / {
try_files $uri $uri/ /index.html;
}
}
}
\ No newline at end of file
import axios from 'axios';
import { redirect } from 'react-router-dom';
// import { redirect } from 'react-router-dom';
export interface IFact {
fact: string;
......
......@@ -6,7 +6,7 @@ services:
context: client
dockerfile: ./Dockerfile
ports:
- 8080-8080
- 4200-4200
networks:
- airline-net
# End React UI Client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment