diff --git a/Dockerfile b/Dockerfile index acf9d2d..9852d82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,14 +4,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /app -RUN adduser -D -S app - COPY requirements.txt /app/ RUN apk --no-cache update && apk --no-cache upgrade -RUN apk add --no-cache --virtual .build-deps build-base mariadb-dev libffi-dev \ - && apk add --no-cache mariadb-connector-c \ - && pip install --no-cache-dir -r requirements.txt \ - && apk del .build-deps +RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ RUN chmod +x /app/entrypoint.sh @@ -21,8 +16,4 @@ EXPOSE 8000 RUN mkdir -pv /fonts COPY tienda/static/fonts/ /fonts/ -RUN chown -R app: /app /fonts -RUN chmod 770 /app/entrypoint.sh -USER app - ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..076a0d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +docker: + docker build -t ghcr.io/dsaub/proyecto-mvc:development . + docker push ghcr.io/dsaub/proyecto-mvc:development + +test: + ./manage.py test \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 7fdb705..c505069 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,11 +1,13 @@ #!/bin/sh +set -eu + echo "Sleeping due to mysql..." sleep 10 echo "Running DB migrations..." python manage.py migrate echo "Collecting STATIC..." -python manage.py collectstatic --noinput +python manage.py collectstatic --noinput --clear echo "Running server!"