Skip to content

Mkdocs

Dockerfile

Docker
FROM python:latest

RUN apt-get update && apt-get upgrade -y

RUN apt-get install -y python3-pip nano sudo

RUN pip3 install mkdocs

ENV DEBIAN_FRONTEND noninteractive

# Create user with sudo privileges
RUN useradd -ms /bin/bash --system --user-group -u 1000 durbok && \
    usermod -aG sudo durbok
# New added for disable sudo password
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Set as default user
USER durbok

RUN sudo mkdir -p /opt/code
RUN sudo chown -R durbok:durbok /opt/code && sudo chmod -R g+w /opt/code

WORKDIR /opt/code
ENV DEBIAN_FRONTEND teletype


RUN /usr/local/bin/python -m pip install --upgrade pip

RUN pip install mkdocs-windmill-dark mkdocs-material mkdocs-nav-enhancements mkdocs-awesome-pages-plugin mkdocs-table-reader-plugin

COPY docker-entrypoint.sh /
RUN ["sudo","chmod","+x","/docker-entrypoint.sh"]

CMD ["sh","-c","/docker-entrypoint.sh"]

docker-entrypoint.sh

Bash
#!/usr/bin/env bash

# Run if there is nothing to do :)
while true; do sleep 9999; done

docker-compose.yml

YAML
version: "3.7"

services:

  mkdocs:
    image: harbor.kafana.dev/kafana/mkdocs
    networks:
      - durbok-net
    deploy:
      placement:
        constraints:
        - node.role == manager
      replicas: 1
      restart_policy:
        condition: on-failure
    volumes:
      - ./code:/opt/code

networks:
  durbok-net:
    external: true
Back to top