-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Assets update is now working properly on Linux
Also added a new Workflow and disabled the Rust workflow. Redesigned Dockerfile
- Loading branch information
1 parent
f0599ae
commit 0103c31
Showing
13 changed files
with
164 additions
and
81 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,41 @@ | ||
name: Push Dev | ||
|
||
on: | ||
push: | ||
branches: [ "dev" ] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# - name: Login to Docker Hub | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ vars.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get short SHA | ||
id: short_sha | ||
run: echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
# context: . | ||
tags: ghcr.io/${{ github.repository_owner }}/sculptor:${{ steps.short_sha.outputs.sha }} | ||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sculptor:buildcache | ||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sculptor:buildcache,mode=max |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,22 +1,37 @@ | ||
FROM rust:1.80.1-alpine3.20 as builder | ||
|
||
WORKDIR /build | ||
|
||
## Chef | ||
# FROM clux/muslrust:stable AS chef | ||
FROM rust:1.81.0-alpine3.20 as chef | ||
USER root | ||
RUN apk add musl-dev libressl-dev | ||
RUN cargo install cargo-chef | ||
WORKDIR /build | ||
|
||
## Planner | ||
FROM chef AS planner | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY src src | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
## Builder | ||
FROM chef AS builder | ||
COPY --from=planner /build/recipe.json recipe.json | ||
# Build dependencies - this is the caching Docker layer! | ||
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json | ||
# Build application | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY src src | ||
RUN cargo build --release --target x86_64-unknown-linux-musl --bin sculptor | ||
|
||
RUN cargo build --release | ||
|
||
FROM alpine:3.20.0 | ||
|
||
## Runtime | ||
FROM alpine:3.20.0 AS runtime | ||
WORKDIR /app | ||
COPY --from=builder /build/target/x86_64-unknown-linux-musl/release/sculptor /app/sculptor | ||
|
||
COPY --from=builder /build/target/release/sculptor /app/sculptor | ||
RUN apk add --no-cache tzdata | ||
ENV TZ=Etc/UTC | ||
|
||
VOLUME [ "/app/avatars" ] | ||
VOLUME [ "/app/data" ] | ||
VOLUME [ "/app/logs" ] | ||
EXPOSE 6665/tcp | ||
|
||
CMD ["./sculptor"] | ||
CMD [ "./sculptor" ] |
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
Oops, something went wrong.