Skip to content

Commit

Permalink
chore: fix docker docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov committed Oct 11, 2023
1 parent 61abb19 commit 3fbf071
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ docker-docs:
--name=nextclade-docs-builder-$(shell date +%s) \
--init \
--user=$(shell id -u):$(shell id -g) \
--volume=$(shell pwd):/home/user/src \
--volume=$(shell pwd):/workdir \
--publish=8000:8000 \
--workdir=/home/user/src \
--env 'TERM=xterm-256colors' \
nextclade-docs-builder


Expand Down
43 changes: 24 additions & 19 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM continuumio/miniconda3:4.9.2
FROM continuumio/miniconda3

SHELL ["bash", "--login", "-euxo", "pipefail", "-c"]

ARG DEBIAN_FRONTEND=noninteractive
ARG USER=user
Expand All @@ -9,8 +11,20 @@ ARG GID
ENV TERM="xterm-256color"
ENV HOME="/home/user"


RUN set -euxo pipefail >/dev/null \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -qq --yes \
&& apt-get install -qq --no-install-recommends --yes \
make \
sudo \
>/dev/null \
&& apt-get clean autoclean >/dev/null \
&& apt-get autoremove --yes >/dev/null \
&& rm -rf /var/lib/apt/lists/*

# Make a user and group
RUN set -x >/dev/null \
RUN set -euxo pipefail >/dev/null \
&& \
if [ -z "$(getent group ${GID})" ]; then \
addgroup --system --gid ${GID} ${GROUP}; \
Expand All @@ -34,27 +48,18 @@ RUN set -x >/dev/null \
&& echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& touch ${HOME}/.hushlogin \
&& chown -R ${UID}:${GID} "${HOME}"

RUN set -x \
&& chown -R ${USER}:${GROUP} ${HOME}
&& chown -R ${UID}:${GID} "${HOME}" \
&& chown -R ${USER}:${GROUP} ${HOME}

COPY environment.yml ${HOME}/src/
WORKDIR /workdir

WORKDIR ${HOME}/src
COPY environment.yml /workdir

RUN set -x \
&& conda env create docs.clades.nextstrain.org
RUN set -euxo pipefail >/dev/null \
&& conda env create -n "docs.clades.nextstrain.org"

USER ${USER}

RUN set -x \
&& conda init bash \
&& echo "conda activate docs.clades.nextstrain.org" >> ${HOME}/.bashrc
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "docs.clades.nextstrain.org", "bash", "-euo", "pipefail", "-c"]

CMD bash -c "set -x \
&& source ${HOME}/.bashrc \
&& cd ${HOME}/src/docs \
&& rm -rf build \
&& make autobuild \
"
CMD ["cd docs && make autobuild"]

0 comments on commit 3fbf071

Please sign in to comment.