docker
This commit is contained in:
parent
46ed0d600d
commit
6ef8363e1b
3 changed files with 19 additions and 3 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -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
|
||||
4
start.sh
4
start.sh
|
|
@ -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
8
wait_for_db.sh
Executable 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."
|
||||
Loading…
Add table
Reference in a new issue