-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (28 loc) · 845 Bytes
/
Dockerfile
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
45
46
47
# Flutter build
FROM ghcr.io/cirruslabs/flutter:stable AS flutter_builder
RUN flutter config --enable-web --no-cli-animations && flutter doctor
WORKDIR /app/
COPY ./frontend/pubspec.* .
RUN flutter pub get
COPY ./frontend .
RUN flutter build web
# Stage Go build
FROM golang:1.23-alpine AS go_builder
WORKDIR /app
COPY ./core .
# arg substitution
# https://stackoverflow.com/questions/44438637/arg-substitution-in-run-command-not-working-for-dockerfile
ARG VERSION
ENV BV=${VERSION}
# for sqlite
ENV CGO_ENABLED=1
RUN apk update && apk add --no-cache gcc musl-dev
RUN go mod tidy
COPY --from=flutter_builder /app/build/web ./web
# Build optimized binary without debugging symbols
RUN go build -o multipacman
# Stage: Final stage
FROM alpine:latest
WORKDIR /app/
COPY --from=go_builder /app/multipacman .
CMD ["./multipacman"]