I’m trying to deploy Django application with Dockerfile.
I have added the below codes in Dockerfile -
ARG PYTHON_VERSION=3.10-slim-buster
ARG DEBIAN_FRONTEND=noninteractive
FROM python:${PYTHON_VERSION}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code
WORKDIR /code
#install the linux packages, since these are the dependencies of some python packages
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
cron \
wkhtmltopdf \
&& rm -rf /var/lib/apt/lists/* !
COPY requirements.txt /tmp/requirements.txt
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code
And added the below codes in render.toml,
[deploy]
startCommand = "sh /code/release.sh"
And, added the below in release.sh,
#!/usr/bin/env sh
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py runserver 0.0.0.0:$PORT
But, after building, it’s not run/execute the release.sh.
What’s the proper way to implement this?