Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Adicionando o docker
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandragi committed Jun 15, 2021
1 parent 9912309 commit dd2c198
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
.env
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM rust:1.52.1 as build
COPY . /app
WORKDIR /app
RUN cargo build --release

FROM ubuntu:20.04
RUN apt update
RUN apt install -y curl openssl libssl-dev
COPY --from=build /app/target/release/kurosawa_dia /app/kurosawa_dia
WORKDIR /app
RUN chmod +x kurosawa_dia
ENTRYPOINT [ "./kurosawa_dia" ]
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3"
services:
bot:
build:
context: .
dockerfile: Dockerfile
container_name: kurosawa_dia_bot
image: kurosawa_dia_bot
depends_on:
- db
networks:
- kurosawa_dia
environment:
KUROSAWA_TOKEN: ${KUROSAWA_TOKEN}
KUROSAWA_BOT_ID: ${KUROSAWA_BOT_ID}
KUROSAWA_WEEB_API_TOKEN: ${KUROSAWA_WEEB_API_TOKEN}
KUROSAWA_DATABASE_CONNECTION_STRING: mysql://root:${KUROSAWA_DATABASE_PASSWORD}@db:3306
KUROSAWA_DATABASE_NAME: ${KUROSAWA_DATABASE_NAME}
KUROSAWA_DANBOORU_TOKEN: ${KUROSAWA_DANBOORU_TOKEN}
KUROSAWA_VIOLET_TOKEN: ${KUROSAWA_VIOLET_TOKEN}
db:
image: mariadb:10.5
container_name: kurosawa_dia_db
volumes:
- mariadb:/var/lib/mysql
environment:
MARIADB_ROOT_PASSWORD: ${KUROSAWA_DATABASE_PASSWORD}
networks:
- kurosawa_dia
networks:
kurosawa_dia:
driver: bridge
volumes:
mariadb:

0 comments on commit dd2c198

Please sign in to comment.