This repository has been archived by the owner on Dec 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add Dockerfile * Edit readme * Update readme * Update port * Add text * add issue for header * Update docs link
- Loading branch information
1 parent
19c523f
commit 9afbfe0
Showing
5 changed files
with
108 additions
and
12 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/ | ||
Dockerfile |
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,22 @@ | ||
name: tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
docker-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set GITHUB_TAG env | ||
id: vars | ||
run: echo ::set-output name=GITHUB_TAG::${GITHUB_REF:10} # Remove /refs/head/ | ||
- name: Publish to Registry | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: reacherhq/backend | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
tags: "latest,${{ steps.vars.outputs.GITHUB_TAG }}" |
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 @@ | ||
# From https://shaneutt.com/blog/rust-fast-small-docker-image-builds/ | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Cargo Build Stage | ||
# ------------------------------------------------------------------------------ | ||
|
||
FROM messense/rust-musl-cross:x86_64-musl as cargo-build | ||
|
||
WORKDIR /usr/src/reacher | ||
|
||
RUN rm -f target/x86_64-unknown-linux-musl/release/deps/reacher* | ||
|
||
COPY . . | ||
|
||
RUN cargo build --release --target=x86_64-unknown-linux-musl | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Final Stage | ||
# ------------------------------------------------------------------------------ | ||
|
||
FROM alpine:latest | ||
|
||
RUN addgroup -g 1000 reacher | ||
|
||
RUN adduser -D -s /bin/sh -u 1000 -G reacher reacher | ||
|
||
WORKDIR /home/reacher/bin/ | ||
|
||
COPY --from=cargo-build /usr/src/reacher/target/x86_64-unknown-linux-musl/release/heroku . | ||
|
||
RUN chown reacher:reacher heroku | ||
|
||
USER reacher | ||
|
||
ENV RUST_LOG=reacher=info | ||
ENV RCH_HTTP_HOST=0.0.0.0 | ||
ENV PORT=8080 | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["./heroku"] |
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