This commit is contained in:
mahdavi 2022-09-02 13:27:05 +04:30
parent 46ed0d600d
commit 6ef8363e1b
3 changed files with 19 additions and 3 deletions

View file

@ -2,8 +2,14 @@ FROM debian:11
ENV PYTHONUNBUFFERED 1
WORKDIR /app
RUN apt update
RUN apt install libmysqlclient-dev libssl-dev libcrypto++-dev lsb-release -y
RUN apt install gnupg2 -y
RUN echo "deb http://repo.mysql.com/apt/debian/ bullseye mysql-8.0" >> /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
RUN apt update
RUN apt install libmysqlclient-dev libssl-dev libcrypto++-dev lsb-release python3-pip -y
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
RUN apt install netcat -y
RUN apt update
RUN pwd
COPY . /app
RUN python manage.py migrate

View file

@ -5,4 +5,6 @@ while ! nc -z db 3306 ; do
sleep 3
done
python manage.py runserver 0.0.0.0:8000
pwd
python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000

8
wait_for_db.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
while ! nc -z db 3306 ; do
echo "Waiting for the MySQL Server"
sleep 3
done
echo "MySQL ok."