Perfect the entrypoint
Previously unexplored entrypoint technology has been explored. Now we can run commands after the entrypoint completes with the magical "$@" variable.
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -1,4 +1,6 @@
|
||||
FROM python:3.8.2
|
||||
FROM python:3
|
||||
|
||||
USER root
|
||||
|
||||
WORKDIR /app
|
||||
COPY config config
|
||||
@@ -8,10 +10,13 @@ COPY manage.py manage.py
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY scripts scripts
|
||||
RUN chmod +x scripts/*
|
||||
ENTRYPOINT ["scripts/entrypoint.sh"]
|
||||
|
||||
RUN useradd -ms /bin/bash django
|
||||
RUN chown -R django .
|
||||
|
||||
USER django
|
||||
RUN python manage.py collectstatic
|
||||
RUN python manage.py collectstatic --no-input
|
||||
|
||||
CMD ["gunicorn","-b",":8000", "-w", "4", "config.wsgi"]
|
||||
CMD ["scripts/cmd.sh"]
|
||||
|
||||
Reference in New Issue
Block a user