mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
Create Dockerfile
This commit is contained in:
parent
78638a9737
commit
7553633257
1 changed files with 19 additions and 0 deletions
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
|||
FROM golang:alpine AS builder
|
||||
ENV CGO_ENABLED 1
|
||||
RUN apk add gcc && apk --no-cache --update add build-base
|
||||
ENV DST_DIR=/opt/x-ui
|
||||
ENV TMP_DIR=/tmp/x-ui
|
||||
|
||||
WORKDIR ${TMP_DIR}
|
||||
COPY . .
|
||||
RUN go build main.go
|
||||
|
||||
FROM alpine:latest
|
||||
ENV DST_DIR=/opt/x-ui
|
||||
ENV TMP_DIR=/tmp/x-ui
|
||||
WORKDIR ${DST_DIR}
|
||||
COPY --from=builder ${TMP_DIR}/main ${DST_DIR}/x-ui
|
||||
COPY --from=builder ${TMP_DIR}/bin ${DST_DIR}/bin
|
||||
|
||||
VOLUME [ "/etc/x-ui" ]
|
||||
CMD ["./x-ui","run"]
|
Loading…
Reference in a new issue