This commit is contained in:
2026-01-03 19:46:45 +03:00
parent c6c3cf2227
commit 8c9ea53964
3 changed files with 25 additions and 1 deletions

4
Dockerfile.client Normal file
View File

@@ -0,0 +1,4 @@
FROM nginx:1.27-alpine
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY public /usr/share/nginx/html

19
docker/nginx.conf Normal file
View File

@@ -0,0 +1,19 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://server:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
try_files $uri $uri/ /index.html;
}
}

View File

@@ -4,8 +4,9 @@ import { randomUUID } from "crypto";
import DBAdapter, { getCurrentDate, setCurrentDate } from "./db/database.js"; import DBAdapter, { getCurrentDate, setCurrentDate } from "./db/database.js";
import { DB_INTERNAL_ERROR, DB_USER_ERROR } from "./db/database.js"; import { DB_INTERNAL_ERROR, DB_USER_ERROR } from "./db/database.js";
// Switch to .env for test in local machine
dotenv.config({ dotenv.config({
path: './server/.env' path: './server/docker.env'
}); });
const { const {