Nginx
This commit is contained in:
4
Dockerfile.client
Normal file
4
Dockerfile.client
Normal 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
19
docker/nginx.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user