From fcc02aa3a74857026e6b2e45e32723f6fb986a84 Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Tue, 3 Sep 2024 15:14:20 -0400 Subject: [PATCH 1/2] Deployment with docker --- dev/Dockerfile | 15 +++++++++++++++ dev/README.md | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 dev/Dockerfile diff --git a/dev/Dockerfile b/dev/Dockerfile new file mode 100644 index 0000000..bb1d979 --- /dev/null +++ b/dev/Dockerfile @@ -0,0 +1,15 @@ +FROM hubmap/api-base-image:1.0.0 + +LABEL description="DEV Server for Assayclasses" + +WORKDIR /usr/src/app + +COPY . . + +RUN yum install -y && \ + pip install --upgrade pip -r requirements.txt && \ + yum clean all + +EXPOSE 8181 + +CMD [ "python", "-m" , "app"] diff --git a/dev/README.md b/dev/README.md index fb4d66a..944a399 100644 --- a/dev/README.md +++ b/dev/README.md @@ -64,4 +64,12 @@ The `/assayclasses/` endpoint searches the same [assayclasses.json f "vitessce_hints": [] } } +``` + +## Deployment on DEV VM + +First build a new docker image using the Dockerfile. Then spin up the container + +``` +docker run -it -d -p 8181:8181 --restart=always ``` \ No newline at end of file From 063c1330356574bb0124ef06712ad3862e3b5799 Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Tue, 3 Sep 2024 17:53:25 -0400 Subject: [PATCH 2/2] Docker deployment --- dev/Dockerfile | 4 +--- dev/README.md | 16 ++++++++++++---- dev/docker-compose.yml | 13 +++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 dev/docker-compose.yml diff --git a/dev/Dockerfile b/dev/Dockerfile index bb1d979..0cdd64a 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -6,9 +6,7 @@ WORKDIR /usr/src/app COPY . . -RUN yum install -y && \ - pip install --upgrade pip -r requirements.txt && \ - yum clean all +RUN pip install --upgrade pip -r requirements.txt EXPOSE 8181 diff --git a/dev/README.md b/dev/README.md index 944a399..e38aef3 100644 --- a/dev/README.md +++ b/dev/README.md @@ -66,10 +66,18 @@ The `/assayclasses/` endpoint searches the same [assayclasses.json f } ``` -## Deployment on DEV VM +## Docker Deployment on DEV VM -First build a new docker image using the Dockerfile. Then spin up the container +First build a new docker image ``` -docker run -it -d -p 8181:8181 --restart=always -``` \ No newline at end of file +docker compose build +``` + +Then spin up the container + +``` +docker compose up -d +``` + +Once the container is up running correctly, you can access at `http://gateway.dev.hubmapconsortium.org:8181/assayclasses` diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml new file mode 100644 index 0000000..906423f --- /dev/null +++ b/dev/docker-compose.yml @@ -0,0 +1,13 @@ +services: + + assayclasses-dev-server: + build: + context: . + container_name: assayclasses-dev-server + ports: + - "8181:8181" + init: true + restart: always + volumes: + - "./instance:/usr/src/app/instance" + \ No newline at end of file