add Dockerfile and docker-compose.yml

This commit is contained in:
2026-05-23 09:47:38 +08:00
parent a02925dfd0
commit 1850c58197
3 changed files with 32 additions and 0 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
node_modules
dist
.git
.claude
npm-debug.log*
Dockerfile*

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:1.27-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

10
docker-compose.yml Normal file
View File

@@ -0,0 +1,10 @@
services:
dronecan-webtools:
build:
context: .
dockerfile: Dockerfile
image: dronecan-webtools:latest
container_name: dronecan-webtools
ports:
- "8080:80"
restart: unless-stopped