Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
WGOS committed Aug 19, 2024
0 parents commit 95b6316
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-docker.yaml
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
28 changes: 28 additions & 0 deletions Dockerfile
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
17 changes: 17 additions & 0 deletions zroxy.conf
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

0 comments on commit 95b6316

Please sign in to comment.