Dockerfile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Pelican with asciidoc support Dockerfile
  2. # Clone from minimal linux alpine image
  3. FROM alpine
  4. MAINTAINER Lertsenem <lertsenem@lertsenem.com>
  5. EXPOSE 22
  6. EXPOSE 80
  7. # System installations
  8. RUN apk update \
  9. && apk add \
  10. asciidoc \
  11. bash \
  12. git \
  13. make \
  14. nginx \
  15. openssh \
  16. python \
  17. python3 \
  18. py-pip \
  19. supervisor \
  20. && rm -rf /var/cache/apk/* \
  21. && adduser -h /srv/git \
  22. -s /bin/bash \
  23. -G nginx \
  24. -D \
  25. pelican \
  26. && passwd -u pelican \
  27. && rm /etc/supervisord.conf \
  28. && rm /etc/ssh/sshd_config \
  29. && rm /etc/motd \
  30. && rm /etc/nginx/nginx.conf \
  31. && rm -r /etc/nginx/conf.d/ \
  32. && ssh-keygen -A \
  33. && mkdir /srv/www \
  34. && chmod 775 /srv/www \
  35. && chown pelican:nginx /srv/www
  36. COPY run.sh /run.sh
  37. COPY nginx.conf /etc/nginx/nginx.conf
  38. COPY supervisord.conf /etc/supervisord.conf
  39. COPY sshd.conf /etc/ssh/sshd_config
  40. # Pelican installation
  41. RUN pip install html5lib \
  42. pelican \
  43. markdown
  44. # Pelican parameters
  45. USER pelican
  46. RUN mkdir -p /srv/git/.ssh \
  47. && mkdir -p /srv/git/blog.git \
  48. && ln -s blog.git /srv/git/blog \
  49. && git init --bare /srv/git/blog.git \
  50. && touch /srv/git/.ssh/authorized_keys \
  51. && chmod 700 /srv/git/.ssh \
  52. && chmod 640 /srv/git/.ssh/authorized_keys
  53. COPY git.post-receive /srv/git/blog.git/hooks/post-receive
  54. USER root
  55. CMD /run.sh