-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 95b6316
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
schedule: | ||
- cron: "0 0 * * sun" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: zroxy | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
context: . | ||
file: ./Dockerfile | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM alpine:latest as builder | ||
|
||
RUN apk add --update alpine-sdk git cmake make | ||
|
||
WORKDIR /source | ||
|
||
RUN git clone https://github.com/0x7a657573/zroxy.git . \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake .. \ | ||
&& make | ||
|
||
FROM alpine:latest | ||
|
||
ARG USER=app | ||
ARG HOME=/app | ||
|
||
ENV PATH=$PATH:/app | ||
|
||
RUN adduser -h $HOME -D $USER | ||
|
||
USER $USER | ||
WORKDIR $HOME | ||
|
||
COPY --from=builder /source/build/zroxy . | ||
ADD --chown=app:app ./zroxy.conf . | ||
|
||
CMD zroxy -c /app/zroxy.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# set log level | ||
# log level 0 -> LOG_TRACE, 1 -> LOG_DEBUG, | ||
# 2 -> LOG_INFO, 3 -> LOG_WARN, | ||
# 4 -> LOG_ERROR, 5 -> LOG_FATAL | ||
# pattern: log = <log level> | ||
# example: log = 3 | ||
log = 2 | ||
|
||
# sni server set bind ip and port. | ||
# pattern: port = <bind ip>:<local port>@<remote port> | ||
# example: port = 127.0.0.1:8080@80,4433@433,853... | ||
PORT = 0.0.0.0:80@80,443@443 | ||
|
||
# enable statistics monitor | ||
# pattern : monitor = <port> | ||
# example: monitor = 8123 | ||
MONITOR = 8123 |