Document Docker installation

This commit is contained in:
Martin Mahner 2019-12-07 13:03:18 +01:00
parent f86f298a03
commit 101060e6e5
3 changed files with 32 additions and 4 deletions

View File

@ -35,5 +35,33 @@ please create an *Issue* there.
⚠️ dpaste requires at a minimum Python 3.6 and Django 2.2.
Run dpaste using Docker:
========================
Docker images are in `Docker Hub`_.
You can try the latest of dpaste using Docker. This will store the snippet
database in a SQLite file in a Docker volume:
.. code:: bash
$ docker run --rm -p 8000:8000 barttc/dpaste:latest
If you want to run it in production-like environments, it's encouraged to
use an external database. See the example below for all available options,
specifically ``DATABASE_URL``:
.. code:: bash
$ docker run --rm --name db1 --detach postgres:latest
$ docker run --rm -p 12345:12345 \
--link db1 \
-e DATABASE_URL=postgres://postgres@db1:5432/postgres \
-e DEBUG=True \
-e SECRET_KEY=very-secret-key \
-e PORT=12345 \
barttc/dpaste:latest
.. _dpaste.de: https://dpaste.de/
.. _pastebin: https://en.wikipedia.org/wiki/Pastebin
.. _Docker Hub: https://hub.docker.com/repository/docker/barttc/dpaste

View File

@ -89,7 +89,7 @@ INSTALLED_APPS = [
"dpaste.apps.dpasteAppConfig",
]
sys.stdout.write(f"🐘 Database URL is: {env('DATABASE_URL')}")
sys.stdout.write(f"\n🐘 Database URL is: {env('DATABASE_URL')}\n")
DATABASES = {
"default": dj_database_url.config(default="sqlite:///dpaste.sqlite")
}
@ -103,7 +103,7 @@ DATABASES = {
try:
import django_webserver
INSTALLED_APPS.append('django_webserver')
sys.stdout.write(f'🚀 Production webserver installed. Will run on port {env("PORT")}\n\n')
sys.stdout.write(f'\n🚀 Production webserver installed. Will run on port {env("PORT")}\n')
except ImportError:
pass

View File

@ -10,11 +10,11 @@ def main():
import dpaste.settings.local
settings = "dpaste.settings.local"
sys.stdout.write("\n🧁 Using local.py settings file.\n\n")
sys.stdout.write("\n🧁 Using local.py settings file.\n")
except ImportError:
settings = "dpaste.settings.base"
sys.stdout.write(
"\n⚠️ local.py settings not found. Using default settings file.\n\n"
"\n⚠️ local.py settings not found. Using default settings file.\n"
)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings)