This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
114 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copied from .gitignore. | ||
.vscode | ||
.git | ||
.gitignore | ||
config.json | ||
*.db | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
*.so | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
*.manifest | ||
*.spec | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
*.mo | ||
*.pot | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
instance/ | ||
.webassets-cache | ||
.scrapy | ||
docs/_build/ | ||
target/ | ||
.ipynb_checkpoints | ||
profile_default/ | ||
ipython_config.py | ||
.python-version | ||
celerybeat-schedule | ||
*.sage.py | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
.spyderproject | ||
.spyproject | ||
.ropeproject | ||
/site | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
.pyre/ |
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,23 @@ | ||
FROM python:3.7-alpine | ||
LABEL maintainer "Timur Demin <me@tdem.in>" | ||
WORKDIR /app | ||
ENV UWSGI_PORT 8080 | ||
ENV UWSGI_PROCESSES 1 | ||
ENV UWSGI_THREADS 2 | ||
|
||
COPY requirements.txt setup.py setup.cfg /app/ | ||
COPY bin /app/bin | ||
COPY --chown=0:0 doc/config.json.example /etc/amber.json | ||
COPY project_amber /app/project_amber | ||
|
||
# we need gcc to build cffi, which is required by bcrypt | ||
RUN adduser -D -u 1000 amber && \ | ||
mkdir -p /data && chown amber /data && chmod 700 /data && \ | ||
apk add --no-cache build-base libffi-dev && \ | ||
pip install -r requirements.txt && \ | ||
pip install uwsgi && \ | ||
apk del build-base libffi-dev && \ | ||
chmod +x /app/bin/run_uwsgi.sh | ||
|
||
USER amber | ||
CMD [ "sh", "/app/bin/run_uwsgi.sh" ] |
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,10 @@ | ||
#!/bin/sh | ||
|
||
/usr/local/bin/uwsgi \ | ||
--http :${UWSGI_PORT} \ | ||
--master \ | ||
--plugin python,http \ | ||
--manage-script-name \ | ||
--mount /=project_amber:app \ | ||
--processes ${UWSGI_PROCESSES} \ | ||
--threads ${UWSGI_THREADS} |
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,5 @@ | ||
{ | ||
"database": "sqlite:////data/amber.db", | ||
"allow_signup": true, | ||
"loglevel": 2 | ||
} |