[ 参照](https://github.com/leanote/leanote/wiki/Leanote-%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6% E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B ---- Mac-and-Linux)
コマンド:
docker build -t myleanote:1.0.
docker run -it -v /home/leanote_data/data:/home/data -v /home/leanote_data/files:/home/leanote/files -p 9000:9000-e NOTEHOST="https://note.superpig.win"--name leanote myleanote:1.0
注意:
Backstage management-configration-convertpdf
を xvfb-runwkhtmltopdf
に設定します
dockerfile
FROM ubuntu:18.04
MAINTAINER yzh
RUN apt-get update && apt-get install -y \
wget \
xvfb libfontconfig wkhtmltopdf
# vim
RUN cd /home;mkdir data
RUN cd /home;wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.1.tgz;tar -xzvf mongodb-linux-x86_64-3.0.1.tgz
RUN cd /home;wget https://sourceforge.net/projects/leanote-bin/files/2.6.1/leanote-linux-amd64-v2.6.1.bin.tar.gz/download;mv download leanote-linux-amd64-v2.6.1.bin.tar.gz;tar -zxvf leanote-linux-amd64-v2.6.1.bin.tar.gz
RUN cd /home/;rm *.tar.gz;rm *.tgz
RUN cd /usr/share/fonts/truetype/dejavu/;wget https://github.com/sonatype/maven-guide-zh/raw/master/content-zh/src/main/resources/fonts/simsun.ttc
ENV PATH="${PATH}:/home/mongodb-linux-x86_64-3.0.1/bin"
ENV NOTEHOST="http://localhost:9000"
RUN ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
RUN echo "mongorestore -h localhost -d leanote --dir /home/leanote/mongodb_backup/leanote_install_data/">/home/init.sh
RUN echo "cd /home/leanote/conf; sed -i 's@http://localhost:9000@'"\$NOTEHOST"'@g' app.conf">/home/runall.sh
RUN echo "nohup mongod --dbpath /home/data --smallfiles &">>/home/runall.sh
RUN echo "sleep 3">>/home/runall.sh
RUN echo "cd /home;bash init.sh">>/home/runall.sh
RUN echo "cd /home;echo '# mongorestore -h localhost -d leanote --dir /home/leanote/mongodb_backup/leanote_install_data/'>init.sh ">>/home/runall.sh
RUN echo "cd /home/leanote/bin;">>/home/runall.sh
RUN echo "sleep 3">>/home/runall.sh
RUN echo "bash run.sh">>/home/runall.sh
CMD ["/bin/bash","/home/runall.sh"]
Recommended Posts