From cac711d2f6422227b90d75658d0d75c63e46efaf Mon Sep 17 00:00:00 2001 From: Amir Date: Wed, 28 Aug 2024 16:23:12 +0200 Subject: [PATCH] fixing admin user --- Dockerfile | 2 ++ Procfile | 2 +- docker-compose.yml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index b3cc5e4b..94cf4be5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,8 @@ COPY . /app/ RUN python manage.py collectstatic --noinput --clear RUN python manage.py migrate --noinput +RUN python manage.py createsuperuser --username admin --email admin@example.com --password mysecretpassword --noinput + EXPOSE 8000 diff --git a/Procfile b/Procfile index 5a48897c..ed6dfe34 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn saburly.wsgi:application --bind 0.0.0.0:8000 +web: gunicorn saburly.wsgi:application --bind 0.0.0.0:$PORT \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..7855d465 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: 3 +services: + app: + build: . + environment: + - DATABASE_URL=sqlite:///app/sqlite-data/db.sqlite3 + - PORT=80 + volumes: + - sqlite-data:/app/sqlite-data + +volumes: + sqlite-data: \ No newline at end of file