diff --git a/Dockerfile b/Dockerfile index 030167ea..2aa8c966 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,8 @@ RUN mkdir /opt/recipes RUN chown recipes:recipes /opt/recipes WORKDIR /opt/recipes COPY --chown=recipes:recipes . ./ -RUN chmod +x boot.sh +RUN chmod +x boot.sh setup.sh +RUN ln -s /opt/recipes/setup.sh /usr/local/bin/createsuperuser # hadolint ignore=DL3018 RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev && \ diff --git a/README.md b/README.md index c0ff63be..2a86988d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ When clicking submit, every recipe containing the word will be updated (tags are 2. Choose one of the included configurations [here](https://github.com/vabene1111/recipes/tree/develop/docs/docker). 3. Copy (if needed) the `docker-compose.override.yml.template` to `docker-compose.override.yml` and uncomment the configurations you need. 4. Start the container (`docker-compose up -d`) -5. Create a default user by executing into the container with `docker-compose exec web_recipes sh` and run `python3 manage.py createsuperuser`. +5. Create a default user by running `docker-compose exec -it createsuperuser`. **Replace "" with your instance name which can be found via running `docker ps`** ### Manual Copy `.env.template` to `.env` and fill in the missing values accordingly. diff --git a/boot.sh b/boot.sh index ffab2425..0605d78d 100644 --- a/boot.sh +++ b/boot.sh @@ -2,8 +2,8 @@ source venv/bin/activate echo "Updating database" -python3 manage.py migrate -python3 manage.py collectstatic --noinput +python manage.py migrate +python manage.py collectstatic --noinput echo "Done" exec gunicorn -b :8080 --access-logfile - --error-logfile - recipes.wsgi \ No newline at end of file diff --git a/setup.sh b/setup.sh new file mode 100644 index 00000000..49286f83 --- /dev/null +++ b/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh +source venv/bin/activate +echo "Creating Superuser." +python manage.py createsuperuser +echo "Done" \ No newline at end of file