faraday容器化部署方案

    因为官方的Docker镜像已经太老了,经过尝试,走通如下容器化部署方案

    镜像构建文件

FROM ubuntu:18.04
# https://vuepress.mirror.docker-practice.com/image/build.html
# https://github.com/infobyte/faraday/wiki/Install-Guide#pypi
RUN apt update 
    && apt upgrade  -y 
    && apt install -y postgresql sudo 
    && apt install -y python3-pip libpq-dev 
    && pip3 install -i https://pypi.douban.com/simple/  PyYAML faradaysec

ENV LC_ALL=C.UTF-8 
    LANG=C.UTF-8

CMD faraday-server

    建议Postgresql服务器单独部署,部署方法见:

https://github.com/infobyte/faraday/wiki/Remote-PostgreSQL-database-configuration

     

     镜像中的一个文件需要改动,上面那个文档中说文件位置是/home/faraday/.faraday/config/server.ini,我们经过测试,发现真正的配置文件位置是

/root/.faraday/config/server.ini

    第一次启动之前需要运行

faraday-manage create-tables

    由于Docker重构建的时间比较长,这个方案的尝试调试过程挺浪费时间的,说一点 apt install那个地方不要改动,改动可能会导致构建停在一个时区配置输入的位置。

原文地址:https://www.cnblogs.com/dhcn/p/13187590.html