Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
nanokvm-usb:
build:
context: ./
dockerfile: Dockerfile
image: sipeed/nanokvm-usb:latest
container_name: nanokvm-usb
ports:
- "9000:80"
38 changes: 38 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
}