-
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.
Merge pull request #7 from GiganticMinecraft/build/docker
build: Docker のサポート
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
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,15 @@ | ||
### Rust template | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM rust:1.73.0-bullseye as Builder | ||
|
||
WORKDIR /root/app | ||
COPY --chown=root:root . . | ||
|
||
RUN cargo build --release --bin idea-reaction | ||
|
||
FROM debian:bullseye-slim as Runner | ||
|
||
COPY --from=Builder --chown=root:root /root/app/target/release/idea-reaction /usr/local/bin/idea-reaction | ||
|
||
RUN apt-get update && apt-get install -y libssl-dev ca-certificates | ||
|
||
RUN useradd --create-home --user-group idea-reaction | ||
USER idea-reaction | ||
WORKDIR /home/idea-reaction | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/GiganticMinecraft/idea-reaction | ||
|
||
ENTRYPOINT [ "idea-reaction" ] |
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,8 @@ | ||
services: | ||
bot: | ||
build: . | ||
restart: always | ||
volumes: | ||
- ./config.yaml:/home/idea-reaction/assets/config.yaml | ||
env_file: | ||
- ./.env |