mirror of
https://github.com/xingsu1021/pthelper.git
synced 2026-06-18 01:36:25 +08:00
43 lines
1.1 KiB
Docker
43 lines
1.1 KiB
Docker
# pull official base image
|
|
FROM a76yyyy/ddddocr:latest
|
|
|
|
# set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
# create the appropriate directories
|
|
ENV APP_HOME=/home/data/www
|
|
RUN mkdir -p $APP_HOME
|
|
WORKDIR $APP_HOME
|
|
|
|
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
|
|
COPY requirements_alpine.txt requirements.txt
|
|
|
|
#将需要的包体全部打包成直接安装的包whl
|
|
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple/
|
|
|
|
COPY start.sh /usr/local/bin/start.sh
|
|
RUN chmod +x /usr/local/bin/start.sh
|
|
|
|
# copy project
|
|
COPY . $APP_HOME
|
|
|
|
RUN ln -s /home/data/www/db /db && \
|
|
ln -s /home/data/www/logs /logs && \
|
|
ln -s /home/data/www/backups /backups && \
|
|
rm -rf conf && \
|
|
rm -rf docker-compose.yml && \
|
|
rm -rf Dockerfile && \
|
|
rm -rf README.md && \
|
|
rm -rf requirements.txt && \
|
|
rm -rf db/* logs/* backups/* \
|
|
rm -rf .git*
|
|
|
|
EXPOSE 80
|
|
#apt-get安装路径
|
|
#CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
|
#pip安装路径
|
|
#CMD ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
|
|
|
CMD ["/usr/local/bin/start.sh"] |