码迷,mamicode.com
首页 > 其他好文 > 详细

docker-compose文件

时间:2020-06-05 21:22:38      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:data   point   project   ln -s   rm -rf   work   python   pack   ports   

docker-compose 

version: "3"
services:
  user-dashboard:
    build: .
    volumes:
      - .:/data/code/
      - /proc:/writable-proc
    ports:
      - "8891:8891"
    networks:
      - walkoff_network
    restart: always
    container_name: new_user-dashboard

networks:
    walkoff_network:
      external: true

Dockerfile

FROM python:3.6
# Add
ADD deploy/sources.list /etc/apt/sources.list
ADD deploy/secrets  /home/
# Packages
#RUN apt-get update
# Language
#RUN apt-get install -y locales
#RUN locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
# 设置时区
#RUN apt-get install -y tzdata
RUN rm -f /etc/localtime
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV TZ=:/etc/localtime
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV LANGUAGE=C.UTF-8
# timezone.
ENV TZ=GMT-8

# PIP Mirror
RUN mkdir -p /root/.pip/
ADD deploy/pip.conf /root/.pip/

# project dir
RUN rm -rf /data && mkdir -p /data/
WORKDIR /data/code/


ADD requirements.txt /data/
RUN pip install --no-cache-dir -r /data/requirements.txt


RUN rm -rf /data/code/ && mkdir -p /data/code/
#env
ENV FLASK_APP wsgi.py
EXPOSE 8891
ENTRYPOINT ["/data/code/deploy/run.sh"]

  

  

docker-compose文件

标签:data   point   project   ln -s   rm -rf   work   python   pack   ports   

原文地址:https://www.cnblogs.com/weidaijie/p/13051659.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!