mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
Add Docker (#58)
This commit is contained in:
11
.github/workflows/docker.yml
vendored
11
.github/workflows/docker.yml
vendored
@@ -3,7 +3,12 @@ on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
inputs:
|
||||
project:
|
||||
description: 'Project'
|
||||
required: true
|
||||
default:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
@@ -40,5 +45,5 @@ jobs:
|
||||
docker buildx build \
|
||||
--platform=linux/amd64,linux/arm64 \
|
||||
--output "type=image,push=true" \
|
||||
--file ${{ secrets.DOCKER_HUB_REPOSITORY }}/Dockerfile ./${{ secrets.DOCKER_HUB_REPOSITORY }} \
|
||||
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/${{ secrets.DOCKER_HUB_REPOSITORY }}:latest
|
||||
--file ./Dockerfile ./ \
|
||||
--tag $(echo "${DOCKERHUB_USERNAME}" | tr '[:upper:]' '[:lower:]')/${{ github.event.inputs.project }}:latest
|
||||
|
||||
@@ -5,10 +5,13 @@ RUN go build main.go
|
||||
|
||||
|
||||
FROM debian:11-slim
|
||||
LABEL org.opencontainers.image.authors="hossin.asaadi77@gmail.com"
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
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/Shanghai
|
||||
WORKDIR /root
|
||||
COPY --from=builder /root/main /root/x-ui
|
||||
COPY bin/. /root/bin/.
|
||||
COPY ./bin/. /root/bin/.
|
||||
VOLUME [ "/etc/x-ui" ]
|
||||
CMD [ "./x-ui" ]
|
||||
|
||||
@@ -115,7 +115,7 @@ systemctl restart x-ui
|
||||
|
||||
## Install using docker
|
||||
|
||||
> This docker tutorial and docker image are provided by [Chasing66](https://github.com/Chasing66)
|
||||
> This docker tutorial and docker image are provided by [hossinasaadi](https://github.com/hossinasaadi)
|
||||
|
||||
1. install docker
|
||||
|
||||
@@ -131,7 +131,7 @@ docker run -itd --network=host \
|
||||
-v $PWD/db/:/etc/x-ui/ \
|
||||
-v $PWD/cert/:/root/cert/ \
|
||||
--name x-ui --restart=unless-stopped \
|
||||
enwaiax/x-ui:latest
|
||||
hossinasaadi/x-ui:latest
|
||||
```
|
||||
|
||||
> Build your own image
|
||||
|
||||
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
version: '3.9'
|
||||
services:
|
||||
xui:
|
||||
image: hossinasaadi/x-ui
|
||||
container_name: x-ui
|
||||
volumes:
|
||||
- $PWD/db/:/etc/x-ui/
|
||||
- $PWD/cert/:/root/cert/
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
Reference in New Issue
Block a user