Initial commit.
This commit is contained in:
commit
8ab883d0b9
8 changed files with 78 additions and 0 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
volumes/python/data/**
|
||||||
|
volumes/postgres/pg_data/**
|
||||||
|
**/__pycache__/**
|
||||||
|
**/.pyc
|
30
Dockerfile
Normal file
30
Dockerfile
Normal 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
0
README.md
Normal file
30
docker-compose.yml
Normal file
30
docker-compose.yml
Normal 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
3
requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
discord
|
||||||
|
psycopg2-binary
|
||||||
|
sqlalchemy
|
1
volumes/postgres/config/pgdb.key
Normal file
1
volumes/postgres/config/pgdb.key
Normal file
|
@ -0,0 +1 @@
|
||||||
|
5Spgqd4MpNNRUoA8prJ4ddwSwAtZYq3f1LHK00O1NWSIV0yAXL2DhaKWnNaaJ5eo
|
5
volumes/python/lib/werefox_bot_runtime.py
Normal file
5
volumes/python/lib/werefox_bot_runtime.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/python
|
||||||
|
|
||||||
|
def run():
|
||||||
|
print('This is a test.')
|
||||||
|
|
5
werefox_discord_bot.py
Normal file
5
werefox_discord_bot.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/python
|
||||||
|
|
||||||
|
from lib.werefox_bot_runtime import run
|
||||||
|
|
||||||
|
run()
|
Reference in a new issue