diff --git a/browser-domain/.dockerignore b/browser-domain/.dockerignore index e3ff84a..5d1de82 100644 --- a/browser-domain/.dockerignore +++ b/browser-domain/.dockerignore @@ -1,6 +1,7 @@ node_modules Dockerfile.prod Dockerfile.test +Dockerfile.dev docker-compose.dev.yml docker-compose.yml docker-template.yml diff --git a/browser-domain/Dockerfile.dev b/browser-domain/Dockerfile.dev new file mode 100644 index 0000000..d50678d --- /dev/null +++ b/browser-domain/Dockerfile.dev @@ -0,0 +1,18 @@ +FROM node:17.9.1 AS app +WORKDIR /app +COPY package.json . +COPY package-lock.json . +RUN npm install +COPY . . + +ENV REACT_APP_ENDPOINT "http://host.docker.internal:5001" + +RUN npm run build + +FROM nginx:alpine +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=app /app/build . +COPY nginx/default-dev.conf /etc/nginx/conf.d/default.conf +EXPOSE 8000 +ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/browser-domain/docker-compose.dev.yml b/browser-domain/docker-compose.dev.yml index 08890cc..c727b36 100644 --- a/browser-domain/docker-compose.dev.yml +++ b/browser-domain/docker-compose.dev.yml @@ -7,4 +7,6 @@ services: file: docker-template.yml service: browser-client container_name: fids-browser-dev_browser-client + extra_hosts: + - "host.docker.internal:host-gateway" network_mode: host diff --git a/browser-domain/nginx/default-dev.conf b/browser-domain/nginx/default-dev.conf new file mode 100644 index 0000000..b096709 --- /dev/null +++ b/browser-domain/nginx/default-dev.conf @@ -0,0 +1,15 @@ +server { + listen 8000; + location / { + root /usr/share/nginx/html; + index unresolvable-file-html.html; + try_files $uri @index; + } + + location @index { + root /usr/share/nginx/html; + add_header Cache-Control no-cache; + expires 0; + try_files /index.html =404; + } +} diff --git a/browser-domain/src/components/CreateFlight/CreateFlight.tsx b/browser-domain/src/components/CreateFlight/CreateFlight.tsx index fd6fcc0..9d61dd4 100644 --- a/browser-domain/src/components/CreateFlight/CreateFlight.tsx +++ b/browser-domain/src/components/CreateFlight/CreateFlight.tsx @@ -47,6 +47,7 @@ export const CreateFlight = () => { setFlightData({ ...flightData, flight_code: e.target.value }) } @@ -56,6 +57,7 @@ export const CreateFlight = () => { Status: setFlightData({ ...flightData, status: e.target.value }) @@ -67,6 +69,7 @@ export const CreateFlight = () => { setFlightData({ ...flightData, origin: e.target.value }) } @@ -76,6 +79,7 @@ export const CreateFlight = () => { Destination: setFlightData({ ...flightData, destination: e.target.value }) @@ -86,6 +90,7 @@ export const CreateFlight = () => { Departure Time: setFlightData({ ...flightData, departure_time: e.target.value }) @@ -96,6 +101,7 @@ export const CreateFlight = () => { Arrival Time: setFlightData({ ...flightData, arrival_time: e.target.value }) @@ -106,11 +112,12 @@ export const CreateFlight = () => { Gate: setFlightData({ ...flightData, gate: e.target.value })} /> - + ); }; diff --git a/browser-domain/src/components/Home/Home.tsx b/browser-domain/src/components/Home/Home.tsx index 0002654..6d1a174 100644 --- a/browser-domain/src/components/Home/Home.tsx +++ b/browser-domain/src/components/Home/Home.tsx @@ -52,7 +52,7 @@ export const Home: React.FC = (props) => { return (
- {isAirline ? : <>} + {isAirline ? : <>} {isAdmin ? : <>}

Flights

diff --git a/browser-domain/src/components/LogIn/LogIn.tsx b/browser-domain/src/components/LogIn/LogIn.tsx index 79ed4fe..4c6bb8c 100644 --- a/browser-domain/src/components/LogIn/LogIn.tsx +++ b/browser-domain/src/components/LogIn/LogIn.tsx @@ -16,10 +16,12 @@ export const LogIn = () => {
setEmail(ev.target.value)} /> setPassword(ev.target.value)} /> diff --git a/browser-domain/src/components/SignUp/SignUp.tsx b/browser-domain/src/components/SignUp/SignUp.tsx index 909add1..976e895 100644 --- a/browser-domain/src/components/SignUp/SignUp.tsx +++ b/browser-domain/src/components/SignUp/SignUp.tsx @@ -19,18 +19,22 @@ export const SignUp = () => { setEmail(ev.target.value)} /> setUsername(ev.target.value)} /> setPassword(ev.target.value)} /> setRepeatPassword(ev.target.value)} />