-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
44 lines (22 loc) · 681 Bytes
/
dockerfile
File metadata and controls
44 lines (22 loc) · 681 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
37
38
39
40
41
42
43
44
FROM node:20-alpine AS frontend-builder
WORKDIR /Lb-web
COPY Lb-web/package.json Lb-web/package-lock.json ./
RUN npm install
COPY Lb-web/ .
RUN npm run build
FROM golang:1.25.4-alpine AS backend-builder
RUN apk add --no-cache build-base
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o localbase-app cmd/server/main.go
FROM alpine:latest
WORKDIR /app
RUN apk --no-cache add ca-certificates
COPY --from=backend-builder /app/localbase-app .
COPY --from=frontend-builder /Lb-web/dist ./Lb-web/dist
RUN mkdir -p storage/ledger storage/sites
COPY .env .
EXPOSE 8080
CMD [ "./localbase-app" ]