This commit is contained in:
romantarkin 2025-07-22 18:07:11 +05:00
parent d3186463a6
commit 4fd203d44f
4 changed files with 33 additions and 1 deletions

View File

@ -11,7 +11,7 @@ map $scheme $hsts_header {
server { server {
set $forward_scheme http; set $forward_scheme http;
set $server "client"; set $server "client";
set $port 3000; set $port 80;
listen 80; listen 80;
listen [::]:80; listen [::]:80;

View File

@ -66,6 +66,15 @@ services:
- ./data:/data - ./data:/data
- ./letsencrypt:/etc/letsencrypt - ./letsencrypt:/etc/letsencrypt
client:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: client
restart: always
depends_on:
auth-service:
condition: service_started
volumes: volumes:
mysql_data: mysql_data:

12
frontend/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
# build stage
FROM node:20 AS build
WORKDIR /app
COPY . .
RUN npm install && npm run build
# production stage
FROM nginx:alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

11
frontend/nginx.conf Normal file
View File

@ -0,0 +1,11 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri /index.html;
}
}