Skip to content

Commit

Permalink
Merge pull request #7 from GiganticMinecraft/build/docker
Browse files Browse the repository at this point in the history
build: Docker のサポート
  • Loading branch information
m1sk9 authored Oct 14, 2023
2 parents 6422c3b + e4f42a3 commit a9280c9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .dockerignore
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
2 changes: 1 addition & 1 deletion .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ runs:
with:
push: true
tags: |
ghcr.io/giganticminecraft/idea_reaction:latest
ghcr.io/giganticminecraft/idea-reaction:latest
20 changes: 20 additions & 0 deletions Dockerfile
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" ]
8 changes: 8 additions & 0 deletions compose.yaml
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

0 comments on commit a9280c9

Please sign in to comment.