Dockerize
This commit is contained in:
@@ -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"]
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
services:
|
||||||
|
wiji-web:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: deploy/Dockerfile
|
||||||
|
container_name: wiji-web
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "8421:8421"
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user