-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from LanceMaverick/dockerfy
Add ability to use docker for skybeard
- Loading branch information
Showing
12 changed files
with
117 additions
and
6 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 |
---|---|---|
|
@@ -7,6 +7,7 @@ config.py | |
config.yml | ||
.#* | ||
*.db | ||
docker-compose.yml | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
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,19 @@ | ||
FROM python:3 | ||
|
||
# Use bash as the shell because we will need to source a virtualenv later | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Create a skybeard user | ||
RUN useradd -m skybeard | ||
USER skybeard | ||
WORKDIR /home/skybeard | ||
|
||
# Make a few directories which will be mounted to later | ||
RUN mkdir code db db_binary_entries skybeard_virtualenv | ||
|
||
# Create a base virtualenv. Normally, there's no need for a virtualenv in a | ||
# docker container, but since any beards that run can add to the requirements, | ||
# we'll need a virutalenv tied to a persistant container | ||
RUN python3 -m venv skybeard_virtualenv_frozen | ||
ADD requirements.txt . | ||
RUN . /home/skybeard/skybeard_virtualenv_frozen/bin/activate && pip install -r requirements.txt |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
description: Enigma M3 Emulator plugin for Skybeard v2 | ||
git_url: https://github.com/artemis-beta/skb-enigmabeard.git | ||
name: enigmabeard | ||
|
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,3 @@ | ||
description: National Rail Enquiry plugin for Skybeard v2 | ||
git_url: https://github.com/artemis-beta/skb-natrailenq.git | ||
name: natrailenq |
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,4 @@ | ||
description: 'Skybeard 2 plugin: Find answers to your questions using this Skybeard | ||
2 interface for W.I.L.L: https://github.com/ironman5366/W.I.L.L' | ||
git_url: https://github.com/LanceMaverick/skybeard_willbot.git | ||
name: willbeard |
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,31 @@ | ||
beard_paths: | ||
- beards/ | ||
- beard_cache/ | ||
- examples/ | ||
- integration_test_beards/ | ||
|
||
beards: | ||
- askfor | ||
- database | ||
- debugonlyexample | ||
- config_helper | ||
# Integration test beards | ||
- different_name_inside | ||
- oldstyle_beard | ||
|
||
stache_paths: | ||
- moustaches | ||
|
||
staches: | ||
- postcats | ||
|
||
db_url: sqlite:///../db/skybeard-2.db | ||
db_bin_path: ../db_binary_entries/ | ||
|
||
admins: | ||
[ | ||
[Nathanael Farley, 89593615], | ||
] | ||
|
||
host: 0.0.0.0 | ||
port: 8000 |
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,15 @@ | ||
skybeard: | ||
build: . | ||
environment: | ||
- TG_BOT_TOKEN=YOUR_TOKEN_GOES_HERE | ||
- SKYBEARD_CONFIG=config.docker.yml.example | ||
command: ./code/run_on_docker.sh | ||
user: skybeard | ||
volumes: | ||
# This is where the code is hosted | ||
- .:/home/skybeard/code | ||
# These should be unique per bot. If they are not, database information | ||
# and python packages will be shared between bots. | ||
- skybeard_virtualenv:/home/skybeard/skybeard_virtualenv:z | ||
- skybeard_db:/home/skybeard/db:z | ||
- skybeard_db_binary_entries:/home/skybeard/db_binary_entries:z |
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,3 +1,4 @@ | ||
aiohttp | ||
telepot>=10.4 | ||
pyconfig>=3.1.1 | ||
dataset>=0.7.0 | ||
|
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 @@ | ||
#!/usr/bin/env bash | ||
# If the virtualenv is not populated, copy it over. | ||
echo "Let's run skybeard!" | ||
if [[ "$(ls -A ~/skybeard_virtualenv)" ]]; | ||
then | ||
: | ||
else | ||
cp -r ~/skybeard_virtualenv_frozen/* ~/skybeard_virtualenv | ||
fi | ||
source ~/skybeard_virtualenv/bin/activate | ||
cd code | ||
python main.py |
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