docker-compose文件

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"]

相关推荐