Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Add Docker (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
hossinasaadi committed Nov 16, 2022
1 parent bb41997 commit abc67e8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ on:
push:
branches: [ master ]
workflow_dispatch:

inputs:
project:
description: 'Project'
required: true
default:

jobs:

build:
Expand Down Expand Up @@ -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 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ RUN go build main.go


FROM debian:11-slim
LABEL org.opencontainers.image.authors="[email protected]"
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" ]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit abc67e8

Please sign in to comment.