This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
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
Flix
committed
Dec 18, 2022
1 parent
78143da
commit 421bc36
Showing
3 changed files
with
60 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,2 @@ | ||
/target | ||
/vue |
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,29 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- 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: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: flixcoder/gameshow:latest |
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,29 @@ | ||
FROM docker.io/rust:slim-bullseye as builder | ||
ARG CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
|
||
RUN apt update -yqq \ | ||
&& apt install -yqq --no-install-recommends \ | ||
build-essential cmake libssl-dev pkg-config git \ | ||
&& rustup update \ | ||
&& rustup toolchain add stable \ | ||
&& rustup default stable | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
RUN cargo build --release | ||
|
||
|
||
FROM debian:bullseye-slim | ||
RUN apt update && apt install -y ca-certificates | ||
RUN mkdir -p /opt/app | ||
WORKDIR /opt/app | ||
|
||
COPY --from=builder /app/target/release/gameshow-v2 /usr/local/bin/gameshow-v2 | ||
COPY --from=builder /app/questions /opt/app/questions | ||
COPY --from=builder /app/static /opt/app/static | ||
|
||
ENV RUST_BACKTRACE=1 | ||
ENV BIND_ADDRESS="0.0.0.0:8000" | ||
ENV MAX_NICKNAME_LENGTH=25 | ||
|
||
CMD ["/usr/local/bin/gameshow-v2"] |