diff --git a/Dockerfile b/Dockerfile index 9a169db..1eaa320 100755 --- a/Dockerfile +++ b/Dockerfile @@ -5,12 +5,12 @@ RUN apk add --no-cache gcc libc-dev linux-headers # install pypi packages COPY . /django_project RUN pip install --upgrade pip -RUN pip install ./django_project +RUN pip install /django_project RUN pip install uWSGI==2.0.21 -COPY docker/app/uwsgi.ini /uwsgi.ini -COPY docker/app/scripts /scripts +COPY ./docker/uwsgi.ini /uwsgi.ini +COPY ./scripts /scripts RUN chmod -R +x /scripts ENV PATH="/scripts:/py/bin:$PATH" -CMD ["run.sh"] +CMD ["on-deploy.sh"] diff --git a/Makefile b/Makefile index 257950f..d4d9444 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,7 @@ help: .PHONY: init init: - python3 manage.py migrate - python3 manage.py loaddata traits.json booking_types.json - python3 manage.py createsuperuser + ./scripts/on-init.sh .PHONY: get_columns get_columns: diff --git a/README.md b/README.md index 24f694c..700b84e 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ A Django app for user management for makerspaces. ### Install -After install, run `make init` to create the initial database and super user. +After install, run `on-init.sh` to create the initial database and super user. diff --git a/docker-compose.yml b/docker-compose.yml index fc260eb..ca71f7f 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: web: container_name: web - build: ./docker/web/Dockerfile + build: ./docker/web working_dir: /etc/nginx ports: - 80:80 @@ -14,7 +14,7 @@ services: app: container_name: app - build: ./Dockerfile + build: . working_dir: /django_project environment: DJANGO_SECRET_KEY: $DJANGO_SECRET_KEY diff --git a/docker/app/uwsgi.ini b/docker/uwsgi.ini similarity index 100% rename from docker/app/uwsgi.ini rename to docker/uwsgi.ini diff --git a/docker/app/scripts/run.sh b/scripts/on-deploy.sh similarity index 100% rename from docker/app/scripts/run.sh rename to scripts/on-deploy.sh diff --git a/scripts/on-init.sh b/scripts/on-init.sh new file mode 100755 index 0000000..4aa8b07 --- /dev/null +++ b/scripts/on-init.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +python manage.py migrate +python manage.py loaddata traits.json booking_types.json +python manage.py createsuperuser