feat : docker with compose fixes #16

This commit is contained in:
Julio MATARRANZ
2025-09-04 18:38:11 +02:00
parent b769419608
commit 0688fe2c6f
3 changed files with 69 additions and 0 deletions

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM node:24-alpine3.21 AS frontend
WORKDIR /app
COPY browser browser
RUN yarn global add http-server
RUN cd browser && \
yarn install && \
yarn build
FROM nginx:1.29.1-alpine
COPY --from=frontend /app/browser/dist /usr/share/nginx/html
RUN apk add tzdata
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=frontend /app/browser/dist /usr/share/nginx/html
RUN ls -alh /usr/share/nginx/html
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]

9
docker-compose.yml Normal file
View File

@@ -0,0 +1,9 @@
services:
nanokvm-usb:
build:
context: ./
dockerfile: Dockerfile
image: sipeed/nanokvm-usb:latest
container_name: nanokvm-usb
ports:
- "9000:80"

38
nginx.conf Normal file
View File

@@ -0,0 +1,38 @@
worker_processes 1;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
root /usr/share/nginx/html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html;
charset utf-8;
location / {
try_files $uri $uri/ /index.html;
}
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.(?!well-known).* {
deny all;
}
}
}