-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve #62. --------- Signed-off-by: simonsan <[email protected]> Co-authored-by: simonsan <[email protected]>
- Loading branch information
1 parent
f0ab93d
commit 190fc97
Showing
11 changed files
with
141 additions
and
1 deletion.
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
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
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
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
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,26 @@ | ||
name: Release Docker Image | ||
|
||
on: [release] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6 | ||
with: | ||
context: containers | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/rustic-rs/rustic_server:latest,ghcr.io/rustic-rs/rustic_server:${{ github.ref_name }} | ||
build-args: RUSTIC_SERVER_VERSION=${{ github.ref_name }} |
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
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
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
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,21 @@ | ||
FROM alpine AS builder | ||
ARG RUSTIC_SERVER_VERSION | ||
ARG TARGETARCH | ||
RUN if [ "$TARGETARCH" = "amd64" ]; then \ | ||
ASSET="rustic_server-x86_64-unknown-linux-musl.tar.xz";\ | ||
elif [ "$TARGETARCH" = "arm64" ]; then \ | ||
ASSET="rustic_server-aarch64-unknown-linux-musl.tar.xz"; \ | ||
fi; \ | ||
wget https://github.com/rustic-rs/rustic_server/releases/download/${RUSTIC_SERVER_VERSION}/${ASSET} && \ | ||
tar -xf ${ASSET} --strip-components=1 && \ | ||
mkdir /etc_files && \ | ||
touch /etc_files/passwd && \ | ||
touch /etc_files/group | ||
|
||
FROM scratch | ||
COPY --from=builder /rustic-server /rustic-server | ||
COPY --from=builder /etc_files/ /etc/ | ||
EXPOSE 8000 | ||
ENTRYPOINT ["/rustic-server", "serve"] | ||
HEALTHCHECK --interval=90s --timeout=10s --retries=3 \ | ||
CMD curl --fail -s http://localhost:8000/health/live || exit 1 |
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,52 @@ | ||
services: | ||
rustic-server: | ||
image: rustic-server:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
RUSTIC_SERVER_VERSION: "v0.4.0" # Replace with the actual version | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- ./volumes/config:/etc/rustic-server/config:ro | ||
- ./volumes/certs:/etc/rustic-server/certs:ro | ||
- ./volumes/data:/var/lib/rustic-server/data | ||
- ./volumes/logs:/var/log/ | ||
environment: | ||
- RUSTIC_SERVER_LISTEN=0.0.0.0:8000 | ||
- RUSTIC_SERVER_DATA_DIR=/var/lib/rustic-server/data | ||
- RUSTIC_SERVER_QUOTA=0 # 0 means no quota | ||
- RUSTIC_SERVER_VERBOSE=false | ||
# - RUSTIC_SERVER_CONFIG_PATH=/etc/rustic-server/config/server.toml | ||
- RUSTIC_SERVER_DISABLE_AUTH=false | ||
- RUSTIC_SERVER_HTPASSWD_FILE=/var/lib/rustic-server/data/.htpasswd | ||
- RUSTIC_SERVER_PRIVATE_REPOS=true | ||
- RUSTIC_SERVER_APPEND_ONLY=false | ||
- RUSTIC_SERVER_ACL_PATH=/etc/rustic-server/config/acl.toml | ||
- RUSTIC_SERVER_DISABLE_TLS=false | ||
- RUSTIC_SERVER_TLS_KEY=/etc/rustic-server/certs/server.key | ||
- RUSTIC_SERVER_TLS_CERT=/etc/rustic-server/certs/server.crt | ||
- RUSTIC_SERVER_LOG_FILE=/var/log/rustic-server.log | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "10m" | ||
max-file: "3" | ||
healthcheck: | ||
test: ["CMD", "curl", "--fail", "-s", "http://localhost:8000/health/live"] | ||
interval: 90s | ||
timeout: 10s | ||
retries: 3 | ||
networks: | ||
- rustic-network | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.50' | ||
memory: 512M | ||
restart: unless-stopped | ||
|
||
networks: | ||
rustic-network: | ||
driver: bridge |
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