Skip to content
Snippets Groups Projects
Dockerfile 954 B
# This is nrao:capability
ARG TAGNAME="tmp"
FROM cache:${TAGNAME}

# Install curl for healthcheck
USER root
RUN apt update -y && apt install -y curl

# Build arg that sets environment; sets to "dev" if no build arg is given
ARG env=dev
ENV ENV=${env}

# Change working directory to /code
WORKDIR /code

# set ownership of /code directory to vlapipe:vlapipe
RUN chown vlapipe . && chgrp vlapipe .

# Switch to vlapipe
USER vlapipe

# Copy service directory to /code in the image
# set ownership of content to vlapipe and the vlapipe group
COPY --chown=vlapipe:vlapipe ./services/capability ./

ENV PYTHONPATH "${PYTHONPATH}:/home/vlapipe/.local"
ENV PATH "${PATH}:/home/vlapipe/.local/bin"

RUN python setup.py develop --user

# Set Capo for build stage
# Gets reset to proper environment's profile in the deploy stage
ENV CAPO_PROFILE docker

# Don't start until notification and workflow are ready
CMD sh /code/bin/start-capability-with-healthchecks.sh