diff --git a/deploy/Dockerfile b/deploy/Dockerfile new file mode 100644 index 0000000..fb86716 --- /dev/null +++ b/deploy/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3-alpine + +WORKDIR /app + +# Copy only the necessary web assets +COPY index.html favicon.svg ./ +COPY web/ ./web/ + +# Expose a random non-standard port +EXPOSE 8421 + +# Run the python HTTP server +CMD ["python", "-m", "http.server", "8421"] diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml new file mode 100644 index 0000000..053808a --- /dev/null +++ b/deploy/docker-compose.yaml @@ -0,0 +1,9 @@ +services: + wiji-web: + build: + context: .. + dockerfile: deploy/Dockerfile + container_name: wiji-web + restart: unless-stopped + ports: + - "8421:8421" diff --git a/deploy/nginx.conf b/deploy/nginx.conf new file mode 100644 index 0000000..692671c --- /dev/null +++ b/deploy/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 80; + server_name esp32s3-wiji; + + location / { + proxy_pass http://wiji-web:8421; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} diff --git a/deploy/wiji-web.container b/deploy/wiji-web.container new file mode 100644 index 0000000..69fe4ce --- /dev/null +++ b/deploy/wiji-web.container @@ -0,0 +1,12 @@ +[Unit] +Description=WijiBoard Web Frontend Container +After=network-online.target + +[Container] +# Assuming the image is built locally as wiji-web:latest +Image=localhost/wiji-web:latest +ContainerName=wiji-web +PublishPort=8421:8421 + +[Install] +WantedBy=default.target