FROM python:3.8-slim
RUN apt-get update -y && apt-get install gcc -y
COPY ./Django /code
WORKDIR /code/package
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple uwsgi
EXPOSE 8000
RUN chmod 777/code/package/runserver-docker.sh
RUN chmod 777/code/package/start.sh
RUN chmod 777/code/package/GAGA/SQL
RUN chmod 777/code/package/GAGA/SQL/db.sqlite3
RUN chmod 777/code/package/log
RUN chmod 777/code/package/log/admin.log
# Windows环境下编写的start.sh每行命令结尾有多余的\r字符,需移除。
RUN sed -i 's/\r//'./start.sh
# 设置start.sh文件可执行权限
RUN chmod +x ./start.sh
# 设置start.sh文件可执行权限
RUN chmod 777*
CMD ["/bin/sh","/code/package/start.sh"]