Skip to content

Commit

Permalink
fix: dynamic version number fed into the swagger api from docker release
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Mar 21, 2023
1 parent 185ec4c commit 961aa11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM debian:buster-20230227-slim AS cheminf-python-ms

ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION}

# Install runtime dependencies
RUN apt-get update \
&& apt-get upgrade -y \
Expand Down
3 changes: 2 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .routers import converters, chem, compose, decimer
from fastapi.middleware.cors import CORSMiddleware
from fastapi.openapi.utils import get_openapi
import os

app = FastAPI()

Expand Down Expand Up @@ -34,7 +35,7 @@ def custom_openapi():
return app.openapi_schema
openapi_schema = get_openapi(
title="Cheminf Micro Services",
version="0.3.0",
version = os.getenv("RELEASE_VERSION", "pre-release"),
description="This set of essential and valuable microservices is designed to be accessed via API calls to support cheminformatics. Generally, it is designed to work with SMILES-based inputs and could be used to translate between different machine-readable representations, get Natural Product (NP) likeliness scores, visualize chemical structures, and generate descriptors. In addition, the microservices also host an instance of STOUT and another instance of DECIMER (two deep learning models for IUPAC name generation and optical chemical structure recognition, respectively).",
routes=app.routes,
)
Expand Down

0 comments on commit 961aa11

Please sign in to comment.