From 9408d2efb763d36dee4e487cf9a797197aa20109 Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Sun, 18 Dec 2022 18:32:37 -0300 Subject: [PATCH] adding Dockerfile 2, electric boogaloo --- .dockerignore | 4 ++++ Dockerfile | 11 +++++++---- docker-compose.yml | 7 +++++++ docker/nginx/conf.d/default.conf | 9 +++++++++ src/Pages/Auth/Auth.jsx | 2 +- 5 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 .dockerignore create mode 100644 docker-compose.yml create mode 100644 docker/nginx/conf.d/default.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6983330 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.DS_Store +.env +node_modules diff --git a/Dockerfile b/Dockerfile index 138072b..a53916e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM alpine:latest as build RUN apk add --update nodejs npm RUN npm install --global yarn @@ -8,7 +8,10 @@ COPY [".", "/usr/src"] WORKDIR "/usr/src" RUN yarn +RUN yarn build -EXPOSE 3000 - -CMD ["yarn", "start"] \ No newline at end of file +FROM nginx:1.23.1-alpine +EXPOSE 80 +COPY ./docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf +COPY --from=build /usr/src/build /usr/share/nginx/html +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9bd99da --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: "3.8" + +services: + website: + build: . + ports: + - "80:80" \ No newline at end of file diff --git a/docker/nginx/conf.d/default.conf b/docker/nginx/conf.d/default.conf new file mode 100644 index 0000000..7b7cb6c --- /dev/null +++ b/docker/nginx/conf.d/default.conf @@ -0,0 +1,9 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file diff --git a/src/Pages/Auth/Auth.jsx b/src/Pages/Auth/Auth.jsx index ac92cd7..b84df8f 100644 --- a/src/Pages/Auth/Auth.jsx +++ b/src/Pages/Auth/Auth.jsx @@ -75,7 +75,7 @@ function Auth() { }) }} > - {permanentCode || 'lorem ipsum'} + {permanentCode}