mirror of
https://github.com/KevinMidboe/patlite-tower-lights-controller.git
synced 2025-10-29 17:50:29 +00:00
init commit
This commit is contained in:
28
frontend/Dockerfile
Normal file
28
frontend/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
# Stage 1: Build the frontend
|
||||
FROM node:18 AS builder
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy required config and lock files
|
||||
COPY package.json yarn.lock svelte.config.js vite.config.js ./
|
||||
|
||||
# Install dependencies
|
||||
RUN yarn install
|
||||
|
||||
# Copy the rest of the source files
|
||||
COPY . .
|
||||
|
||||
# Build the frontend
|
||||
RUN yarn build
|
||||
|
||||
# Stage 2: Serve with Caddy
|
||||
FROM caddy:2-alpine
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /usr/share/caddy
|
||||
|
||||
# Copy the build output from the previous stage
|
||||
COPY --from=builder /app/dist /usr/share/caddy
|
||||
|
||||
CMD ["caddy", "file-server", "--root", "/usr/share/caddy", "--listen", ":80"]
|
||||
Reference in New Issue
Block a user