forked from ernestoyoofi/headscale-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 830 Bytes
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Build Frontend
FROM node:lts-alpine AS build_frontend
WORKDIR /app/frontend
COPY ./frontend/ ./
RUN npm install
RUN npm run build
# Build Backend & Server Proxy
FROM golang:1.25-alpine AS build_backend
WORKDIR /app/backend
COPY ./backend/ ./
ENV PRODUCTION_BUILD="true"
RUN go mod tidy
RUN go build -ldflags "-X main.Version=v1.0.0-beta" -o /app/backend/serverbin ./cmd/server
# Run On Production
FROM alpine AS base_headscaleui
WORKDIR /app
ENV DIST_FRONTEND=/app/html
ENV UNJWT_SECRET=/app/secret/jwt-token
ENV SQLITE_LOCATION=/app/database/database.db
ENV NODE_ENV=production
ENV APP_MODE=production
COPY --from=build_frontend /app/frontend/dist/ /app/html
COPY --from=build_frontend /app/frontend/public/ /app/html
COPY --from=build_backend /app/backend/serverbin /app/server
EXPOSE 3050
ENTRYPOINT ["/app/server"]