update docker

This commit is contained in:
Alireza Ahmadi
2024-05-22 17:51:18 +02:00
parent c88fb45e27
commit 15105710bc
3 changed files with 7 additions and 8 deletions
+5 -4
View File
@@ -3,17 +3,18 @@ WORKDIR /app
COPY frontend/ ./
RUN npm install && npm run build
FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS backend-builder
FROM golang:1.22-alpine AS backend-builder
WORKDIR /app
ARG TARGETARCH
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
ENV CGO_ENABLED=1
RUN apk --no-cache --update add build-base gcc wget unzip
ENV GOARCH=$TARGETARCH
RUN apk update && apk --no-cache --update add build-base gcc wget unzip
COPY backend/ ./
COPY --from=front-builder /app/dist/ /app/web/html/
RUN go build -o sui main.go
RUN go build -ldflags="-w -s" -o sui main.go
FROM --platform=$BUILDPLATFORM alpine
FROM --platform=$TARGETPLATFORM alpine
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
ENV TZ=Asia/Tehran
WORKDIR /app