From 8b1523b8c484abed432dfd80d4592048e9861405 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sat, 6 Oct 2018 22:42:38 +0200 Subject: Update the compose file and dockerapp file. The development app from the compose file will now apply migrations on boot and additionally, it will use Django's development server along with the current directory mounted read-only into the container in order to support code reloading, helpful while development. --- docker/pysite.dockerapp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'docker/pysite.dockerapp') diff --git a/docker/pysite.dockerapp b/docker/pysite.dockerapp index 4a811861..dc472b2e 100644 --- a/docker/pysite.dockerapp +++ b/docker/pysite.dockerapp @@ -1,8 +1,8 @@ -version: 0.1.0 +version: 0.3.0 name: pysite description: | Our community website, built on Django and PostgreSQL. -#namespace: python-discord +namespace: python-discord maintainers: - name: Johannes Christ email: jc@jchri.st @@ -11,15 +11,16 @@ maintainers: version: "3.6" services: django: - image: registry.gitlab.com/python-discord/projects/site/django:latest + build: + context: . + command: docker/app/migrate_and_serve.sh ports: - "127.0.0.1:4000:4000" environment: DATABASE_URL: "postgres://${pg_user}:${pg_passwd}@${pg_host}/${pg_db}" - DEBUG: 0 + DEBUG: 'false' SECRET_KEY: "${secret_key}" depends_on: - - migrator - postgres postgres: @@ -29,20 +30,10 @@ services: POSTGRES_USER: "${pg_user}" POSTGRES_PASSWORD: "${pg_passwd}" - migrator: - image: registry.gitlab.com/python-discord/projects/site/django:latest - environment: - DATABASE_URL: "postgres://${pg_user}:${pg_passwd}@${pg_host}/${pg_db}" - DEBUG: 0 - SECRET_KEY: "${secret_key}" - command: "python manage.py migrate" - depends_on: - - postgres - --- pg_user: pysite pg_db: pysite -pg_passwd: '' +pg_passwd: supersecretpassword pg_host: postgres secret_key: 'suitable-for-development-only' -- cgit v1.2.3