-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathDockerfile
60 lines (49 loc) · 1.72 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Usage:
#
# /strictdoc$ docker build . -t strictdoc:latest
# /strictdoc$ docker run --name strictdoc --rm -v "$(pwd):/data" -i -t strictdoc:latest
# bash-5.1# strictdoc export .
# bash-5.1# exit
# strictdoc$ firefox docs/output/html/index.html
FROM ubuntu:24.04
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
gosu \
python3 \
python3-pip \
python3-venv \
sudo \
vim \
wget \
&& rm -rf /var/lib/apt/lists/*
# Download and install Google Chrome
RUN wget -q -O google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get update \
&& apt-get install -y ./google-chrome.deb \
&& rm google-chrome.deb
# Create a virtual environment in the user's home directory.
RUN python3 -m venv /opt/venv
# Ensure the virtual environment is used by modifying the PATH.
ENV PATH="/opt/venv/bin:$PATH"
# Install StrictDoc. Set default StrictDoc installation from PyPI but allow
# overriding it with an environment variable.
ARG STRICTDOC_SOURCE="pypi"
ENV STRICTDOC_SOURCE=${STRICTDOC_SOURCE}
RUN if [ "$STRICTDOC_SOURCE" = "pypi" ]; then \
pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir strictdoc; \
else \
pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir git+https://github.com/strictdoc-project/strictdoc.git@${STRICTDOC_SOURCE}; \
fi; \
chmod -R 777 /opt/venv;
# Remove the default 'ubuntu' user.
RUN userdel -r ubuntu 2>/dev/null || true
# Allow updating the UID/GID dynamically at runtime
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set the working directory to the user's home directory.
WORKDIR /data
ENTRYPOINT ["/entrypoint.sh"]