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/ ./ COPY frontend/ ./
RUN npm install && npm run build 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 WORKDIR /app
ARG TARGETARCH ARG TARGETARCH
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE" ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
ENV CGO_ENABLED=1 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 backend/ ./
COPY --from=front-builder /app/dist/ /app/web/html/ 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" LABEL org.opencontainers.image.authors="alireza7@gmail.com"
ENV TZ=Asia/Tehran ENV TZ=Asia/Tehran
WORKDIR /app WORKDIR /app
+2 -2
View File
@@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS singbox-builder
LABEL maintainer="Alireza <alireza7@gmail.com>" LABEL maintainer="Alireza <alireza7@gmail.com>"
WORKDIR /app WORKDIR /app
ARG TARGETOS TARGETARCH ARG TARGETOS TARGETARCH
ARG SINGBOX_VER=v1.8.10 ARG SINGBOX_VER=v1.8.13
ARG SINGBOX_TAGS="with_quic,with_grpc,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_v2ray_api,with_clash_api,with_gvisor" ARG SINGBOX_TAGS="with_quic,with_grpc,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_v2ray_api,with_clash_api,with_gvisor"
ARG GOPROXY="" ARG GOPROXY=""
ENV GOPROXY ${GOPROXY} ENV GOPROXY ${GOPROXY}
@@ -18,7 +18,7 @@ RUN set -ex \
-ldflags "-X \"github.com/sagernet/sing-box/constant.Version=$SINGBOX_VER\" -s -w -buildid=" \ -ldflags "-X \"github.com/sagernet/sing-box/constant.Version=$SINGBOX_VER\" -s -w -buildid=" \
./cmd/sing-box ./cmd/sing-box
FROM --platform=$BUILDPLATFORM alpine FROM --platform=$TARGETPLATFORM alpine
LABEL maintainer="Alireza <alireza7@gmail.com>" LABEL maintainer="Alireza <alireza7@gmail.com>"
ENV TZ=Asia/Tehran ENV TZ=Asia/Tehran
WORKDIR /app WORKDIR /app
-2
View File
@@ -1,6 +1,4 @@
--- ---
version: "3"
services: services:
s-ui: s-ui:
image: alireza7/s-ui image: alireza7/s-ui