Initial commit.

This commit is contained in:
Alexis Werefox 2021-08-27 22:24:24 +00:00
commit 8ab883d0b9
8 changed files with 78 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
volumes/python/data/**
volumes/postgres/pg_data/**
**/__pycache__/**
**/.pyc

30
Dockerfile Normal file
View file

@ -0,0 +1,30 @@
# Pull Python alpine
FROM python:alpine
RUN apk --no-cache add \
gcc \
g++ \
musl-dev \
python3-dev \
postgresql-dev \
libxml2-dev
# Create a new user to run as and set the working directory
ENV USER=werefox
ENV UID=991
ENV GID=991
RUN addgroup -g "${GID}" werefox
RUN adduser \
--disabled-password \
--gecos "" \
--home "/home/werefox" \
--ingroup "${USER}" \
--uid "${UID}" \
"${USER}"
USER werefox
WORKDIR /home/werefox/
ENV PATH="${PATH}:/home/werefox/.local/bin"
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY werefox_discord_bot.py werefox_discord_bot.py
ENTRYPOINT [ "python", "werefox_discord_bot.py" ]

0
README.md Normal file
View file

30
docker-compose.yml Normal file
View file

@ -0,0 +1,30 @@
---
version: "3"
services:
werefox-discord-bot:
build:
context: .
dockerfile: Dockerfile
image: werefox-discord-bot:latest
container_name: wdb_container_service
restart: always
links:
- postgres
volumes:
- ./volumes/python/lib:/home/werefox/lib
- ./volumes/python/data:/home/werefox/data
postgres:
image: postgres:13
restart: always
ports:
- 8131:8131
volumes:
- ./volumes/postgres/pg_data:/var/lib/postgresql/data/pg_data
- ./volumes/postgres/config:/config
environment:
POSTGRES_PASSWORD_FILE: /config/pgdb.key
POSTGRES_DB: werefox_prod
POSTGRES_USER: werefox
POSTGRES_HOST: localhost
POSTGRES_PORT: 8131
PGDATA: /var/lib/postgresql/data/pg_data

3
requirements.txt Normal file
View file

@ -0,0 +1,3 @@
discord
psycopg2-binary
sqlalchemy

View file

@ -0,0 +1 @@
5Spgqd4MpNNRUoA8prJ4ddwSwAtZYq3f1LHK00O1NWSIV0yAXL2DhaKWnNaaJ5eo

View file

@ -0,0 +1,5 @@
#!/bin/python
def run():
print('This is a test.')

5
werefox_discord_bot.py Normal file
View file

@ -0,0 +1,5 @@
#!/bin/python
from lib.werefox_bot_runtime import run
run()