-
Notifications
You must be signed in to change notification settings - Fork 3
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
7 changed files
with
1,293 additions
and
76 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
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,46 +1,51 @@ | ||
FROM python:3.7-slim-buster | ||
|
||
WORKDIR /ecs | ||
|
||
COPY ./nginx/install-nginx.sh . | ||
|
||
RUN bash install-nginx.sh | ||
|
||
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf | ||
# RUN apt-get update \ | ||
# && apt-get install --no-install-recommends --no-install-suggests -y gnupg1 ca-certificates git | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
EXPOSE 8080 | ||
COPY ./nginx/default.conf /etc/nginx/nginx.conf | ||
RUN rm -rf /etc/nginx/conf.d | ||
|
||
# -- Adding Pipfiles | ||
COPY Pipfile ./ | ||
COPY Pipfile.lock ./ | ||
|
||
# -- Install dependencies: | ||
RUN ls -l . \ | ||
&& pip install pipenv \ | ||
RUN pip install pipenv \ | ||
&& set -ex && pipenv install --deploy --system | ||
|
||
COPY . ./ | ||
RUN pip install -e . | ||
|
||
# # Download public key for github.com | ||
# RUN mkdir -m 700 /root/.ssh; \ | ||
# touch -m 600 /root/.ssh/known_hosts; \ | ||
# ssh-keyscan github.com > /root/.ssh/known_hosts | ||
|
||
# # Clone private repository | ||
# RUN --mount=type=ssh,id=github git clone git@github.com:KarrLab/karr_lab_build_config.git /.wc | ||
ENV PORT=${PORT} | ||
ENV PRODUCTION=${PRODUCTION} | ||
ENV MONGO_USERNAME=${MONGO_USERNAME} | ||
ENV MONGO_PASSWORD=${MONGO_PASSWORD} | ||
ENV MONGO_DATANATOR_SERVER=${MONGO_DATANATOR_SERVER} | ||
ENV MONGO_AUTHDB=${MONGO_AUTHDB} | ||
ENV REST_FTX_AWS_PROFILE=${REST_FTX_AWS_PROFILE} | ||
ENV FTX_ENDPOINT=${REST_FTX_ENDPOINT} | ||
ENV AWS_ACCESS_KEY_ID=${REST_FTX_AWS_ACCESS_KEY_ID} | ||
ENV AWS_SECRET_ACCESS_KEY=${REST_FTX_AWS_SECRET_ACCESS_KEY} | ||
ENV AWS_DEFAULT_REGION=${REST_FTX_AWS_DEFAULT_REGION} | ||
|
||
CMD gunicorn --bind 0.0.0.0:8080 "datanator_rest_api.core:application" --daemon && \ | ||
sed -i -e 's/$PORT/'"$PORT"'/g' /etc/nginx/conf.d/default.conf && \ | ||
nginx -g 'daemon off;' | ||
ENV PORT=80 | ||
ENV PRODUCTION=$PRODUCTION | ||
ENV MONGO_USERNAME=$MONGO_USERNAME | ||
ENV MONGO_PASSWORD=$MONGO_PASSWORD | ||
ENV MONGO_DATANATOR_SERVER=$MONGO_DATANATOR_SERVER | ||
ENV MONGO_AUTHDB=$MONGO_AUTHDB | ||
ENV REST_FTX_AWS_PROFILE=$REST_FTX_AWS_PROFILE | ||
ENV REST_FTX_ENDPOINT=$REST_FTX_ENDPOINT | ||
ENV REST_FTX_AWS_ACCESS_KEY_ID=$REST_FTX_AWS_ACCESS_KEY_ID | ||
ENV REST_FTX_AWS_SECRET_ACCESS_KEY=$REST_FTX_AWS_SECRET_ACCESS_KEY | ||
ENV REST_FTX_AWS_DEFAULT_REGION=$REST_FTX_AWS_DEFAULT_REGION | ||
ENV READ_PREFERENCE=$READ_PREFERENCE | ||
|
||
EXPOSE 80/tcp | ||
|
||
# clean up | ||
RUN apt-get purge -y --autoremove git ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list \ | ||
&& if [ -n "$tempDir" ]; then \ | ||
apt-get purge -y --auto-remove \ | ||
&& rm -rf "$tempDir" /etc/apt/sources.list.d/temp.list; \ | ||
fi | ||
|
||
CMD gunicorn --bind 127.0.0.1:8001 "datanator_rest_api.core:application" --daemon \ | ||
&& sed -i -e 's/$PORT/'"$PORT"'/g' /etc/nginx/nginx.conf \ | ||
&& nginx -g 'daemon off;' |
Oops, something went wrong.