diff --git a/.github/workflows/build-deps.yml b/.github/workflows/build-deps.yml new file mode 100644 index 0000000..8117bcf --- /dev/null +++ b/.github/workflows/build-deps.yml @@ -0,0 +1,41 @@ +name: build-deps + +on: + workflow_dispatch: + schedule: + - cron: '0 6 */6 * *' + push: + branches: + - "master" + paths: + - ".github/workflows/build-deps.yml" + - "deps/Dockerfile" + +jobs: + build-deps: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push deps file + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:deps" + file: Dockerfile + push: true + platforms: linux/amd64, linux/arm64, linux/s390x, linux/arm, linux/ppc64le, linux/riscv64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/docker-yarn-dev:deps \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1279ca4..a364784 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ on: - "deps/Dockerfile" jobs: - build-deps: + build: runs-on: ubuntu-latest steps: - @@ -40,4 +40,4 @@ jobs: file: Dockerfile push: true platforms: linux/amd64, linux/arm64, linux/s390x, linux/arm, linux/ppc64le, linux/riscv64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/docker-yarn-dev:deps \ No newline at end of file + tags: ${{ secrets.DOCKERHUB_USERNAME }}/docker-yarn-dev \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 46eb0fd..78658a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,7 @@ LABEL maintainer="M0nius " \ org.opencontainers.image.version="1.0.0" \ org.opencontainers.image.url="https://hub.docker.com/r/monius/docker-yarn-dev" \ org.opencontainers.image.source="https://github.com/Mon-ius/Docker-Yarn-Dev" \ - org.opencontainers.image.base.name="docker.io/monius/docker-yarn-dev" \ No newline at end of file + org.opencontainers.image.base.name="docker.io/monius/docker-yarn-dev" + +COPY entrypoint.sh /run/entrypoint.sh +ENTRYPOINT ["/run/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 5908c09..2aaee25 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,14 @@ Multi-platform: `linux/amd64`, `linux/arm64`, `linux/arm`, `linux/ppc64le`, `linux/s390x` and `linux/riscv64`; +> [!TIP] +> - To use customized `port`, set `-e DEV_PORT=$DEV_PORT`. +> - To use Encryption with `user` and `passwd`, set `DEV_SERVER=$DEV_SERVER` and `-e DEV_AUTH=$DEV_AUTH`. + +```sh +docker run --restart=always -itd \ + --name yarn_dev \ + -e DEV_SERVER=$DEV_SERVER -e DEV_AUTH=$DEV_AUTH \ + -e DEV_PORT=443 \ + monius/docker-yarn-dev +``` \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 658834e..bd8c601 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -366,4 +366,8 @@ $AUTH_PART } EOF +if [ ! -e "/usr/bin/dev-cli" ]; then + echo "sing-box -c /etc/sing-box/config.json run" > /usr/bin/dev-cli && chmod +x /usr/bin/dev-cli +fi + exec "$@" \ No newline at end of file