Simplify first user creation

This commit is contained in:
h4llow3En 2020-03-20 10:50:34 +01:00
parent 391ab5ddac
commit 1e3e03e4af
No known key found for this signature in database
GPG Key ID: E30BD90E953CCB30
4 changed files with 10 additions and 4 deletions

View File

@ -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 && \

View File

@ -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 <web_recipes> createsuperuser`. **Replace "<web_recipes>" 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.

View File

@ -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

5
setup.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
source venv/bin/activate
echo "Creating Superuser."
python manage.py createsuperuser
echo "Done"