Newer
Older
FROM python:3.10-slim-buster as base
# Environment Variables
ENV CAPO_PROFILE docker
ENV CAPO_PATH /home/ssa/capo
# Get postgres/mysql development stuff in the image
RUN apt update \
&& apt install -y --no-install-recommends \
gcc \
libmariadb-dev-compat \
libpq-dev \
&& rm -rf /var/lib/apt/lists
# Create vlapipe group and create vlapipe user placed in vlapipe group
RUN addgroup --gid 6000 vlapipe && \
useradd --create-home --comment "" --gid 6000 --uid 6000 vlapipe
# Create almapipe group and create almapipe user placed in almapipe group
RUN addgroup --gid 9233 almapipe && \
useradd --create-home --comment "" --gid 9233 --uid 9233 almapipe
# needed for unit tests
USER vlapipe
WORKDIR /home/ssa/capo
COPY --chown=vlapipe:vlapipe docker.properties docker.properties
USER root
WORKDIR /code
RUN apt update -y && apt install -y curl nano
RUN chown vlapipe . && chgrp vlapipe .
# package installation
RUN curl -sSL https://install.python-poetry.org | python3 -
#WORKDIR /packages/
ENV PATH "${PATH}:/home/vlapipe/.local/bin"
COPY --chown=vlapipe:vlapipe ./shared ./shared
COPY --chown=vlapipe:vlapipe ./apps/cli ./apps/cli
COPY --chown=vlapipe:vlapipe ./services/capability/requirements.txt ./requirements.txt
COPY --chown=vlapipe:vlapipe ./test-requirements.txt ./test-requirements.txt
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${WS_VERSION} pip install --user -r requirements.txt
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${WS_VERSION} pip install --user -r test-requirements.txt
# Copy service directory to /code in the image
# set ownership of content to vlapipe and the vlapipe group
COPY --chown=vlapipe:vlapipe ./services/capability ./services/capability
WORKDIR /code/services/capability
RUN poetry install

Andrew Kapuscinski
committed

Andrew Kapuscinski
committed

Nathan Bockisch
committed
# Don't start until notification and workflow are ready
CMD sh /code/bin/start-capability-with-healthchecks.sh
CMD ["poetry", "run", "pserve", "--reload", "dev.ini"]