Skip to content

Commit

Permalink
Update deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Wang committed Nov 16, 2020
1 parent 2ac4476 commit 57a6908
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ COPY ./requirements.txt /icees-api/requirements.txt
RUN pip install -r icees-api/requirements.txt

COPY ./app.py /icees-api/app.py
COPY ./handlers.py /icees-api/handlers.py
COPY ./models.py /icees-api/models.py
COPY ./dependencies.py /icees-api/dependencies.py
COPY ./db.py /icees-api/db.py
COPY ./utils.py /icees-api/utils.py
COPY ./terms.txt /icees-api/terms.txt
COPY ./TranslatorReasonersAPI.yaml /icees-api/TranslatorReasonersAPI.yaml
COPY ./features /icees-api/features
COPY ./examples icees-api/examples
COPY ./static /icees-api/static
COPY ./main.sh /icees-api/main.sh

WORKDIR /icees-api

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
CMD ["./main.sh"]
2 changes: 1 addition & 1 deletion db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM postgres:12.3

RUN apt-get update && apt-get install python3 python3-pip -y
RUN pip3 install flask flask-restful flask-limiter sqlalchemy psycopg2-binary scipy gunicorn jsonschema pyyaml tabulate structlog pandas argparse inflection flasgger tx-functional statsmodels==0.12.0
RUN pip3 install sqlalchemy psycopg2-binary scipy gunicorn jsonschema pyyaml tabulate structlog pandas argparse inflection flasgger tx-functional statsmodels==0.12.0 fastapi

ENV PGDATA=/data
ENV ICEES_DBUSER=icees_dbuser
Expand Down
6 changes: 6 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

export $(egrep -v '^#' .env | xargs)

# run api server
uvicorn app:APP --host 0.0.0.0 --port 8080

0 comments on commit 57a6908

Please sign in to comment.