mirror of
https://github.com/sipeed/NanoKVM-USB.git
synced 2026-09-10 21:49:56 -05:00
feat : docker with compose fixes #16
This commit is contained in:
22
Dockerfile
Normal file
22
Dockerfile
Normal 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
9
docker-compose.yml
Normal 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
38
nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user