forked from Materials-Consortia/optimade-python-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.7 | ||
|
||
WORKDIR /app | ||
|
||
# copy repo contents | ||
COPY setup.py README.md ./ | ||
COPY optimade ./optimade | ||
RUN pip install -e .[mongo] | ||
RUN pip install uvicorn | ||
|
||
EXPOSE 80 | ||
|
||
ENV MAIN main | ||
|
||
COPY run.sh ./ | ||
|
||
CMD ["/app/run.sh", "$MAIN"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '2' | ||
|
||
services: | ||
optimade-index: | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
#environment: | ||
# MAIN: main_index | ||
ports: | ||
- '3214:5000' | ||
# - '3214:5001' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#!/bin/bash | ||
if [ "$1" == "index" ] | ||
then | ||
MAIN="main_index" | ||
set -ex | ||
|
||
if [ "${MAIN}" == "main_index" ]; then | ||
PORT=5001 | ||
else | ||
MAIN="main" | ||
PORT=5000 | ||
fi | ||
|
||
uvicorn optimade.server.$MAIN:app --reload --port $PORT | ||
uvicorn optimade.server.$MAIN:app --reload --host 0.0.0.0 --port $PORT |