From 4bd3ab2d2de5c8f709b508535cdea51f553548ce Mon Sep 17 00:00:00 2001 From: Alexis Fourmaux Date: Mon, 11 May 2026 21:47:57 +0200 Subject: [PATCH] feat: add a dummy web UI served by nginx in a container --- server/docker-compose.yml | 10 ++++++++++ server/frontend/Dockerfile | 6 ++++++ server/frontend/nginx.conf | 23 ++++++++++++++++++++++ server/frontend/public/assets/css/main.css | 3 +++ server/frontend/public/index.html | 12 +++++++++++ 5 files changed, 54 insertions(+) create mode 100644 server/frontend/Dockerfile create mode 100644 server/frontend/nginx.conf create mode 100644 server/frontend/public/assets/css/main.css create mode 100644 server/frontend/public/index.html diff --git a/server/docker-compose.yml b/server/docker-compose.yml index d54e0c6..daaea9d 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -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 diff --git a/server/frontend/Dockerfile b/server/frontend/Dockerfile new file mode 100644 index 0000000..abd0680 --- /dev/null +++ b/server/frontend/Dockerfile @@ -0,0 +1,6 @@ +FROM nginx:alpine + +COPY public/ /usr/share/nginx/html/ +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 \ No newline at end of file diff --git a/server/frontend/nginx.conf b/server/frontend/nginx.conf new file mode 100644 index 0000000..6d6422c --- /dev/null +++ b/server/frontend/nginx.conf @@ -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; +} \ No newline at end of file diff --git a/server/frontend/public/assets/css/main.css b/server/frontend/public/assets/css/main.css new file mode 100644 index 0000000..c2140b8 --- /dev/null +++ b/server/frontend/public/assets/css/main.css @@ -0,0 +1,3 @@ +h1 { + color: blue; +} \ No newline at end of file diff --git a/server/frontend/public/index.html b/server/frontend/public/index.html new file mode 100644 index 0000000..1527765 --- /dev/null +++ b/server/frontend/public/index.html @@ -0,0 +1,12 @@ + + + + + + Simugaz WebUI + + + +

Hello, World!

+ + \ No newline at end of file