forked from Dadoum/anisette-v3-server
-
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
Showing
5 changed files
with
87 additions
and
11 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,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: ["Dadoum"] |
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,27 @@ | ||
name: Publish docker image anisette-v3-server | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: | | ||
dadoum/anisette-v3-server:latest | ||
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 |
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,34 @@ | ||
# Base for builder | ||
FROM debian:unstable-slim AS builder | ||
# Deps for builder | ||
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates ldc git clang dub libz-dev libssl-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Build for builder | ||
WORKDIR /opt/ | ||
COPY . . | ||
RUN DC=ldc2 dub build -c "static" --build-mode allAtOnce -b release --compiler=ldc2 | ||
|
||
# Base for run | ||
FROM debian:unstable-slim | ||
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy build artefacts to run | ||
WORKDIR /opt/ | ||
COPY --from=builder /opt/anisette-v3-server /opt/anisette-v3-server | ||
|
||
# Setup rootless user which works with the volume mount | ||
RUN useradd -ms /bin/bash Alcoholic \ | ||
&& mkdir /home/Alcoholic/.config/anisette-v3/lib/ -p \ | ||
&& chown -R Alcoholic /home/Alcoholic/ \ | ||
&& chmod -R +wx /home/Alcoholic/ \ | ||
&& chown -R Alcoholic /opt/ \ | ||
&& chmod -R +wx /opt/ | ||
|
||
# Run the artefact | ||
USER Alcoholic | ||
EXPOSE 6969 | ||
ENTRYPOINT [ "/opt/anisette-v3-server" ] |
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