Skip to content

Instantly share code, notes, and snippets.

@clcollins
Last active May 15, 2019 15:17
Show Gist options
  • Save clcollins/42a60f7dff46b7ab714fd9e6c963165d to your computer and use it in GitHub Desktop.
Save clcollins/42a60f7dff46b7ab714fd9e6c963165d to your computer and use it in GitHub Desktop.
mkdocs in a Docker container
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name localhost;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
FROM ubuntu:17.10
MAINTAINER Chris Collins <collins.christopher@gmail.com>
ENV PKGS python python-pip nginx runit
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y $PKGS
RUN pip install mkdocs
ADD default /etc/nginx/sites-enabled/default
RUN mkdir -p /etc/service/nginx
ADD nginx.run /etc/service/nginx/run
RUN chmod -R a+x /etc/service/nginx
RUN mkdir -p /etc/service/mkdocs
ADD mkdocs.run /etc/service/mkdocs/run
RUN chmod -R a+x /etc/service/mkdocs
EXPOSE 80
#!/bin/bash
cd /mnt
mkdocs build --clean
exec mkdocs serve
#!/bin/bash
exec /usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment