mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
Optimizing Dockerfile
This commit is contained in:
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
project:
|
project:
|
||||||
description: 'Project'
|
description: 'Project'
|
||||||
required: true
|
required: true
|
||||||
default:
|
default: ''
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|||||||
21
Dockerfile
21
Dockerfile
@@ -1,17 +1,16 @@
|
|||||||
FROM golang:latest AS builder
|
FROM golang:1.20-alpine AS builder
|
||||||
WORKDIR /root
|
WORKDIR /app
|
||||||
|
ENV CGO_ENABLED 1
|
||||||
|
RUN apk add gcc && apk --no-cache --update add build-base
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go build main.go
|
RUN go build main.go
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
FROM debian:11-slim
|
|
||||||
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
RUN apk add ca-certificates tzdata
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends -y ca-certificates \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
||||||
ENV TZ=Asia/Tehran
|
ENV TZ=Asia/Tehran
|
||||||
WORKDIR /root
|
WORKDIR /app
|
||||||
COPY --from=builder /root/main /root/x-ui
|
COPY --from=builder /app/main /app/x-ui
|
||||||
COPY ./bin/. /root/bin/.
|
COPY ./bin/. /app/bin/.
|
||||||
VOLUME [ "/etc/x-ui" ]
|
VOLUME [ "/etc/x-ui" ]
|
||||||
CMD [ "./x-ui" ]
|
CMD [ "./x-ui" ]
|
||||||
BIN
db/x-ui.db
Normal file
BIN
db/x-ui.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user