feat: add a dummy web UI served by nginx in a container
This commit is contained in:
parent
e605bf8603
commit
4bd3ab2d2d
5 changed files with 54 additions and 0 deletions
|
|
@ -19,6 +19,16 @@ services:
|
|||
- public
|
||||
- database
|
||||
|
||||
webui:
|
||||
build: ./frontend
|
||||
image: simugaz/frontend:latest
|
||||
ports:
|
||||
- 3000:80
|
||||
networks:
|
||||
- public
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
db:
|
||||
image: postgres:18-alpine
|
||||
restart: unless-stopped
|
||||
|
|
|
|||
6
server/frontend/Dockerfile
Normal file
6
server/frontend/Dockerfile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
FROM nginx:alpine
|
||||
|
||||
COPY public/ /usr/share/nginx/html/
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
23
server/frontend/nginx.conf
Normal file
23
server/frontend/nginx.conf
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /assets/ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript application/json image/svg+xml;
|
||||
}
|
||||
3
server/frontend/public/assets/css/main.css
Normal file
3
server/frontend/public/assets/css/main.css
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
h1 {
|
||||
color: blue;
|
||||
}
|
||||
12
server/frontend/public/index.html
Normal file
12
server/frontend/public/index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang='fr'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||
<title>Simugaz WebUI</title>
|
||||
<link rel='stylesheet' href='/assets/css/main.css'>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue