Skip to content

Commit

Permalink
build: install papi from local instead of Github
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Feb 20, 2024
1 parent ded3936 commit 07f94f8
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Run this Docker file mounting the nomad certs folder in `/home/nomad-certs`
# and lenstcrypt certs in `/home/letsencrypt`:
#
# docker build -t ai4-papi .
# docker run -ti -v /home/ubuntu/nomad-certs:/home/nomad-certs -v /home/ubuntu/letsencrypt:/home/letsencrypt -p 443:443 ai4-papi &
#
# See `docker_refresh.sh` for more information.
# docker build -t ai4-papi -f docker/Dockerfile .

FROM ubuntu:22.04

ARG papi_branch=master

# Install Nomad
# Updated commands: https://developer.hashicorp.com/nomad/tutorials/get-started/gs-install
RUN apt-get update && \
Expand Down Expand Up @@ -39,14 +31,9 @@ ENV NOMAD_CLIENT_KEY=/home/nomad-certs/cli-key.pem
ENV FORWARDED_ALLOW_IPS=172.16.44.228

# Install API
#FIXME: installing directly from Github with pip (`pip install git+https://github.com/`)
# breaks config (does not copy `etc` folder)
# We use the ADD command to force a cache rebuilt when the repo is updated
# see: https://stackoverflow.com/a/65762156
WORKDIR /home
ADD "https://api.github.com/repos/AI4EOSC/ai4-papi/commits/${papi_branch}?per_page=1" latest_commit
RUN git clone -b ${papi_branch} https://github.com/AI4EOSC/ai4-papi
RUN pip3 install -e ai4-papi
WORKDIR /home/ai4-papi
COPY . .
RUN pip3 install -e .

# Run the API
EXPOSE 80
Expand Down

0 comments on commit 07f94f8

Please sign in to comment.