-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update codebase to current live version.
- Loading branch information
Showing
23 changed files
with
1,448 additions
and
41 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 |
---|---|---|
|
@@ -108,3 +108,5 @@ logs | |
db.sqlite | ||
sessions | ||
.idea | ||
images/ | ||
data/ |
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,27 @@ | ||
# define what image we're starting from. | ||
FROM python:3.9-slim | ||
|
||
# Set pip config | ||
ENV PIP_NO_CACHE_DIR=false | ||
|
||
# Create the working directory | ||
WORKDIR /bot | ||
|
||
# Install project dependencies | ||
# - first build tools, because pillow-simd isn't pre-compiled | ||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
python3-dev python3-setuptools libtiff5-dev libjpeg-dev libopenjp2-7-dev \ | ||
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev \ | ||
python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev | ||
RUN pip install -U pillow-simd | ||
# - then normal stuff | ||
COPY requirements.txt ./ | ||
RUN pip install -U -r requirements.txt | ||
|
||
# Copy the source code across last to optimize image rebuilds on code changes | ||
# (skips all above steps if we need to redo) | ||
COPY . . | ||
|
||
# Define the command to run when the container starts | ||
ENTRYPOINT ["python"] | ||
CMD ["-m", "dreaf"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 @@ | ||
version: "3.7" | ||
version: "3" | ||
|
||
# define all containers | ||
services: | ||
postgres: | ||
image: postgres:13-alpine | ||
environment: | ||
- POSTGRES_DB | ||
- POSTGRES_PASSWORD | ||
- POSTGRES_USER | ||
ports: | ||
- 5432:5432 | ||
# my bot's container block | ||
dreaf: | ||
# not using an online image, but building from my own Dockerfile locally | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
# these are host -> internal persistent volume mappings, so redeploys don't wipe important data | ||
volumes: | ||
- ./db:/bot/db | ||
- ./logs:/bot/logs | ||
- .:/bot:ro | ||
# psudo tty to emulate normal console usage. | ||
# this is laziness because my bot is still in development and may have print statements instead of logging | ||
tty: true | ||
# tell it a file to get environmental variables from (optional) | ||
env_file: | ||
- .env |
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,11 @@ | ||
version: "3.7" | ||
|
||
services: | ||
postgres: | ||
image: postgres:13-alpine | ||
environment: | ||
- POSTGRES_DB | ||
- POSTGRES_PASSWORD | ||
- POSTGRES_USER | ||
ports: | ||
- 5432:5432 |
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
Oops, something went wrong.