-
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
4 changed files
with
12 additions
and
15 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 |
---|---|---|
|
@@ -92,7 +92,7 @@ venv/ | |
*/*/*.swp | ||
*/*/*/*.swp | ||
|
||
# Django stuff: | ||
# Django stuff | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
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,26 +1,26 @@ | ||
# Start with a python 3 base image | ||
ARG PYTHON_VERSION=3-alpine | ||
|
||
FROM python:${PYTHON_VERSION} | ||
|
||
RUN \ | ||
apk add --no-cache postgresql-libs && \ | ||
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
RUN apk --purge del .build-deps | ||
|
||
# Install dependencies | ||
RUN \ | ||
apk add --no-cache postgresql-libs && \ | ||
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev && \ | ||
pip install -r requirements.txt --no-cache-dir && \ | ||
apk --purge del .build-deps | ||
|
||
COPY . . | ||
ENV SECRET_KEY=$SECRET_KEY FMP_API_KEY=$FMP_API_KEY | ||
|
||
# Initialize the Postgres database, load the flashcards data, and collect all static files | ||
RUN \ | ||
python stockhelper/manage.py migrate && \ | ||
python stockhelper/manage.py loaddata cards.json && \ | ||
python stockhelper/manage.py collectstatic --noinput | ||
|
||
# Start an HTTP server | ||
EXPOSE 8080 | ||
|
||
CMD ["gunicorn", "--bind", ":8080", "--workers", "2", "--chdir", "stockhelper", "stockhelper.wsgi"] |
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