chokatrue commited on
Commit
1153fcf
·
verified ·
1 Parent(s): 38b80fb

Rename Dockerfile to docker-compose.yml

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -54
  2. docker-compose.yml +16 -0
Dockerfile DELETED
@@ -1,54 +0,0 @@
1
- # ========================================================
2
- # Stage: Builder
3
- # ========================================================
4
- FROM golang:1.23-alpine AS builder
5
- WORKDIR /app
6
- ARG TARGETARCH
7
-
8
- RUN apk --no-cache --update add \
9
- build-base \
10
- gcc \
11
- wget \
12
- unzip
13
-
14
- COPY . .
15
- RUN chown -R 1000:1000 /app
16
-
17
- ENV CGO_ENABLED=1
18
- ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
19
- RUN go build -o build/x-ui main.go
20
- RUN ./DockerInit.sh "$TARGETARCH"
21
-
22
- # ========================================================
23
- # Stage: Final Image of 3x-ui
24
- # ========================================================
25
- FROM alpine
26
- ENV TZ=Asia/Tehran
27
- WORKDIR /app
28
-
29
- RUN apk add --no-cache --update \
30
- ca-certificates \
31
- tzdata \
32
- fail2ban \
33
- bash
34
-
35
- COPY --from=builder /app/build/ /app/
36
- COPY --from=builder /app/DockerEntrypoint.sh /app/
37
- COPY --from=builder /app/x-ui.sh /usr/bin/x-ui
38
-
39
-
40
- # Configure fail2ban
41
- RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \
42
- && cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local \
43
- && sed -i "s/^\[ssh\]$/&\nenabled = false/" /etc/fail2ban/jail.local \
44
- && sed -i "s/^\[sshd\]$/&\nenabled = false/" /etc/fail2ban/jail.local \
45
- && sed -i "s/#allowipv6 = auto/allowipv6 = auto/g" /etc/fail2ban/fail2ban.conf
46
-
47
- RUN chmod +x \
48
- /app/DockerEntrypoint.sh \
49
- /app/x-ui \
50
- /usr/bin/x-ui
51
-
52
- VOLUME [ "/etc/x-ui" ]
53
- CMD [ "./x-ui" ]
54
- ENTRYPOINT [ "/app/DockerEntrypoint.sh" ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docker-compose.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ version: "3"
3
+
4
+ services:
5
+ 3x-ui:
6
+ image: ghcr.io/mhsanaei/3x-ui:latest
7
+ container_name: 3x-ui
8
+ hostname: yourhostname
9
+ volumes:
10
+ - $PWD/db/:/etc/x-ui/
11
+ - $PWD/cert/:/root/cert/
12
+ environment:
13
+ XRAY_VMESS_AEAD_FORCED: "false"
14
+ tty: true
15
+ network_mode: host
16
+ restart: unless-stopped