-
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.
[wip] docker setup intent for easy running
- Loading branch information
1 parent
587fb6a
commit 35b9660
Showing
11 changed files
with
91 additions
and
112 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 @@ | ||
/target | ||
.git | ||
.gitignore |
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,28 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- "feature/docker" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: code checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: install the gcloud cli | ||
uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
project_id: ${{ secrets.GOOGLE_PROJECT }} | ||
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
export_default_credentials: true | ||
|
||
- name: build and push the docker image | ||
env: | ||
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} | ||
run: | | ||
gcloud auth configure-docker us-central1-docker.pkg.dev | ||
docker build -t us-central1-docker.pkg.dev/$GOOGLE_PROJECT/snake-docker/snake:latest . | ||
docker push us-central1-docker.pkg.dev/$GOOGLE_PROJECT/snake-docker/snake:latest |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM messense/rust-musl-cross:x86_64-musl as chef | ||
RUN cargo install cargo-chef wasm-bindgen-cli | ||
RUN rustup target add wasm32-unknown-unknown | ||
RUN apt update && apt install wget | ||
RUN wget https://dmej8g5cpdyqd.cloudfront.net/downloads/noip-duc_3.0.0-beta.7.tar.gz && tar xf noip-duc_3.0.0-beta.7.tar.gz | ||
# RUN ls noip-duc_3.0.0-beta.7/binaries -lah | ||
# RUN noip-duc_3.0.0-beta.7/binaries/noip-duc_3.0.0-beta.7_x86_64-musl | ||
|
||
WORKDIR /snake | ||
FROM chef AS planner | ||
# Copy source code from previous stage | ||
COPY . . | ||
# Generate info for caching dependencies | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef AS builder | ||
COPY --from=planner /snake/recipe.json recipe.json | ||
# Build & cache dependencies | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
# Copy source code from previous stage | ||
COPY . . | ||
# Build application | ||
RUN bash build.sh | ||
|
||
# Create a new stage with a minimal image | ||
FROM scratch | ||
COPY --from=builder /snake/target/x86_64-unknown-linux-musl/release/snake-web /snake-web | ||
ENTRYPOINT ["/snake-web"] | ||
EXPOSE 80 |
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,11 @@ | ||
version: "3" | ||
services: | ||
api: | ||
image: snake:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "80:80" | ||
environment: | ||
PORT_BIND: 80 |
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