Skip to content

Commit

Permalink
Initial workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
parafoxia committed Jul 3, 2020
1 parent 987605d commit 5c27542
Show file tree
Hide file tree
Showing 8 changed files with 652 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# docker
Dockerfile
.dockerignore
docker-compose.yml

# git
.git/
.gitignore

# secrets
secrets/

# editorconfig
.editorconfig

# Documentation
LICENSE
README.md
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 4
indent_style = space

[*.py]
indent_size = 4
indent_style = space
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"editorconfig.editorconfig",
"ms-python.python"
]
}
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"files.encoding": "utf8",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,

"[json]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
},

"[python]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"python.pythonPath": "${workspaceFolder}\\venv\\Scripts\\python.exe",
"python.formatting.provider": "black",
"python.formatting.blackPath": "${workspaceFolder}\\venv\\Scripts\\black.exe",
"python.linting.pylintEnabled": false,
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "${workspaceFolder}\\venv\\Scripts\\mypy.exe",

"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
}
}
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3-slim

RUN apt update && apt install -y curl
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3

WORKDIR /app

COPY pyproject.toml poetry.lock ./
RUN $HOME/.poetry/bin/poetry config virtualenvs.create false
RUN $HOME/.poetry/bin/poetry install --no-ansi --no-root --no-dev

COPY . .
RUN $HOME/.poetry/bin/poetry install --no-ansi --no-dev

CMD ["python3", "-m", "carb"]
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.8"

services:
bot:
build: .

volumes:
- data:/app/data/dynamic

environment:
TOKEN: /run/secrets/token
GUILD_ID: 626608699942764544
HUB_GUILD_ID: 530249508177575952
HUB_STDOUT_ID: 657562932413988873
HUB_RELAY_ID: 657612250768736271
HUB_COMMANDS_ID: 657611609094619146

secrets:
- token

secrets:
token:
file: ./secrets/token

volumes:
data:
Loading

0 comments on commit 5c27542

Please sign in to comment.