Skip to content
Open
Changes from all 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
18 changes: 18 additions & 0 deletions core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

FROM python:3.10.11-slim-bullseye

ARG USER_ONBUILD=cat
ARG UID_ONBUILD=1001
ARG GROUP_ONBUILD=cat
ARG GID_ONBUILD=1001

### SYSTEM SETUP ###
RUN apt-get -y update && apt-get install -y curl build-essential fastjar libmagic-mgc libmagic1 mime-support && \
apt-get clean && \
Expand All @@ -19,6 +24,19 @@ RUN pip install -U pip && \
pip install --no-cache-dir . &&\
python3 -c "import nltk; nltk.download('punkt');nltk.download('averaged_perceptron_tagger')"

### ADD USER ###
RUN groupadd -g ${GID_ONBUILD} ${GROUP_ONBUILD} && \
useradd -m -u ${UID_ONBUILD} -g ${GROUP_ONBUILD} ${USER_ONBUILD} \
&& chown -R ${GROUP_ONBUILD}:${USER_ONBUILD} /app

USER ${GROUP_ONBUILD}:${USER_ONBUILD}

### CREATE HOME LOCAL BIN FOLDER IF NOT EXIST ###
RUN mkdir -p /home/${USER_ONBUILD}/.local/bin

### ADD HOME LOCAL BIN FOLDER TO THE PATH ###
ENV PATH="/home/${USER_ONBUILD}/.local/bin:${PATH}"

### COPY CAT CODE INSIDE THE CONTAINER (so it can be run standalone) ###
COPY ./cat /app/cat

Expand Down