diff --git a/backend/app/config.py b/backend/app/config.py index f0d8e5a..52b2f88 100644 --- a/backend/app/config.py +++ b/backend/app/config.py @@ -4,7 +4,7 @@ from pydantic import BaseSettings class Config(BaseSettings): host: str = '127.0.0.1' - port: int = 8888 + port: int = 80 birthdate: date = date(2007, 10, 13) diff --git a/docker-compose.yml b/docker-compose.yml index b1a0fef..6113c42 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: environment: - BIRTHDATE=2007-10-13 - HOST=0.0.0.0 + # - PORT=80 # default port frontend: image: git.mootfrost.dev/mootfrost777/mootfrost-dev_frontend:latest container_name: mootfrost-dev_frontend @@ -21,4 +22,4 @@ services: - traefik.http.routers.mootfrost_dev.rule=Host(`mootfrost.dev`) # Website port ports: - - "7632:3000" + - "7632:80" diff --git a/frontend/.env b/frontend/.env index 8261e94..dcffc67 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1,3 +1,2 @@ -VITE_BACKEND=http://backend:8888 -VITE +VITE_BACKEND=http://backend VITE_PORT=3000 \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 3ad0da1..1865853 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,10 +1,19 @@ -FROM node:20-alpine +FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN yarn COPY . . -CMD ["yarn", "dev", "--port", "3000", "--host", "0.0.0.0"] +RUN yarn build + +FROM nginx:stable-alpine + +COPY --from=builder /app/dist /usr/share/nginx/html + +RUN rm /etc/nginx/conf.d/default.conf +COPY /nginx/default.conf /etc/nginx/conf.d + +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/nginx/default.conf b/frontend/nginx/default.conf new file mode 100644 index 0000000..ed54522 --- /dev/null +++ b/frontend/nginx/default.conf @@ -0,0 +1,48 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /api { + proxy_pass http://backend; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} \ No newline at end of file