Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
.env
!.gitkeep
__pycache__/
/server/config
/server/venv
55 changes: 22 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,41 @@
ARG TAG=3.10-slim

FROM python:${TAG}

ARG CONTAINER_USER="python"
ARG LANGUAGE_CODE="en"
ARG COUNTRY_CODE="GB"
ARG ENCODING="UTF-8"

ARG LOCALE_STRING="${LANGUAGE_CODE}_${COUNTRY_CODE}"
ARG LOCALIZATION="${LOCALE_STRING}.${ENCODING}"

ARG OH_MY_ZSH_THEME="bira"

RUN apt update && apt -y upgrade && \
apt -y install \
locales \
git \
curl \
inotify-tools \
zsh && \

echo "${LOCALIZATION} ${ENCODING}" > /etc/locale.gen && \
locale-gen "${LOCALIZATION}" && \

useradd -m -u 1000 -s /usr/bin/zsh "${CONTAINER_USER}" && \

bash -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \

cp -v /root/.zshrc /home/"${CONTAINER_USER}"/.zshrc && \
cp -rv /root/.oh-my-zsh /home/"${CONTAINER_USER}"/.oh-my-zsh && \
sed -i "s/\/root/\/home\/${CONTAINER_USER}/g" /home/"${CONTAINER_USER}"/.zshrc && \
sed -i s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"${OH_MY_ZSH_THEME}\"/g /home/${CONTAINER_USER}/.zshrc && \
mkdir /home/"${CONTAINER_USER}"/workspace && \
chown -R "${CONTAINER_USER}":"${CONTAINER_USER}" /home/"${CONTAINER_USER}"
RUN apt-get update && apt-get -y upgrade && \
apt-get -y install --no-install-recommends \
locales git curl inotify-tools zsh && \
echo "${LOCALIZATION} ${ENCODING}" > /etc/locale.gen && \
locale-gen "${LOCALIZATION}" && \
useradd -m -u 1000 -s /usr/bin/zsh "${CONTAINER_USER}" && \
CHSH=no RUNZSH=no KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
cp -v /root/.zshrc /home/${CONTAINER_USER}/.zshrc && \
cp -rv /root/.oh-my-zsh /home/${CONTAINER_USER}/.oh-my-zsh && \
sed -i "s#/root#/home/${CONTAINER_USER}#g" /home/${CONTAINER_USER}/.zshrc && \
sed -i s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"${OH_MY_ZSH_THEME}\"/g /home/${CONTAINER_USER}/.zshrc && \
mkdir -p /home/${CONTAINER_USER}/workspace && \
chown -R ${CONTAINER_USER}:${CONTAINER_USER} /home/${CONTAINER_USER}

USER ${CONTAINER_USER}

ENV USER ${CONTAINER_USER}
ENV LANG "${LOCALIZATION}"
ENV LANGUAGE "${LOCALE_STRING}:${LANGUAGE_CODE}"
ENV USER=${CONTAINER_USER}
ENV LANG=${LOCALIZATION}
ENV LANGUAGE=${LOCALE_STRING}:${LANGUAGE_CODE}
ENV PATH=/home/${CONTAINER_USER}/.local/bin:${PATH}
ENV LC_ALL "${LOCALIZATION}"
ENV LC_ALL=${LOCALIZATION}

# work in the same place you mount in compose
WORKDIR /home/${CONTAINER_USER}/workspace

ADD ./src/approov-protected-server/token-binding-check/requirements.txt .

RUN pip3 install -r requirements.txt && \
pip3 install virtualenv
# install deps; we only copy requirements, code is bind-mounted
ADD ./server/requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt && \
pip3 install --no-cache-dir virtualenv

CMD ["zsh"]
110 changes: 0 additions & 110 deletions EXAMPLES.md

This file was deleted.

55 changes: 0 additions & 55 deletions OVERVIEW.md

This file was deleted.

50 changes: 0 additions & 50 deletions QUICKSTARTS.md

This file was deleted.

Loading