-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored Dockerfile to generate a more lightweight image, added a docker-compose file to quickly kick off your application. Also improved security since tokens have to be mounted instead of being built into the image.
- Loading branch information
1 parent
9b1ff1b
commit 9fe4e1f
Showing
6 changed files
with
31 additions
and
10 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,5 @@ | ||
README.md | ||
CONTRIBUTING.md | ||
**/__pycache__/ | ||
.git/ | ||
token |
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,12 @@ | ||
name: "Dev Image Build" | ||
run-name: ${{ github.actor }} Dev Image Build | ||
on: [pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "Job triggered by ${{ github.event_name }}." | ||
- uses: actions/checkout@v3 | ||
- run: docker --version | ||
- run: docker build -t morningbot-dev . | ||
- run: docker image ls | grep morningbot-dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
FROM python:latest | ||
|
||
FROM gorialis/discord.py | ||
FROM python:3.11-slim | ||
|
||
RUN mkdir -p /usr/src/MorningBot | ||
|
||
WORKDIR /usr/src/MorningBot | ||
|
||
COPY . . | ||
RUN pip install -r requirements.txt | ||
|
||
CMD ["python3", "main.py"] | ||
CMD ["python3", "."] |
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,6 @@ | ||
version: '3' | ||
services: | ||
morningbot: | ||
image: morningbot:latest | ||
volumes: | ||
- ./token:/usr/src/MorningBot/token |