-
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
11 changed files
with
770 additions
and
72 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,3 @@ | ||
*.egg-info | ||
node_modules | ||
*.pyc |
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,36 @@ | ||
FROM node:10 as client | ||
WORKDIR /app/rh/client | ||
COPY ./rh/client/package.json ./rh/client/yarn.lock ./ | ||
RUN NOYARNBUILD=1 yarn install | ||
COPY ./rh/client/ ./ | ||
RUN yarn build | ||
|
||
|
||
FROM python:3.6-buster as build | ||
RUN pip install -U pip pipenv | ||
WORKDIR /app | ||
ENV PIPENV_VENV_IN_PROJECT=1 DJANGO_SETTINGS_MODULE=rh.settings.deploy SECRET_KEY=s ALLOWED_HOSTS=* | ||
COPY Pipfile Pipfile.lock setup.py setup.cfg ./ | ||
COPY rh/__init__.py ./rh/__init__.py | ||
RUN pipenv install --deploy | ||
COPY . . | ||
COPY --from=client /app/rh/client ./rh/client | ||
RUN pipenv run manage.py collectstatic --noinput | ||
|
||
|
||
FROM python:3.6-slim-buster | ||
WORKDIR /app | ||
ENV PATH=/app/.venv/bin:${PATH} DJANGO_SETTINGS_MODULE=rh.settings.deploy PORT=8000 | ||
RUN set -ex && \ | ||
apt-get update -qq && apt-get install --no-install-recommends -y libpq5 && rm -rf /var/lib/apt/lists/* && \ | ||
groupadd -r rh && useradd --uid=1000 --no-log-init -r -g rh rh && \ | ||
mkdir -p /app && chown rh:rh /app | ||
COPY --from=build /etc/mime.types /etc/mime.types | ||
COPY --from=build --chown=rh:rh /app ./ | ||
# stats | ||
EXPOSE 1717/tcp | ||
# web server | ||
EXPOSE 8000/tcp | ||
USER rh | ||
CMD uwsgi --ini=uwsgi.ini | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
import sys | ||
|
||
def manage(): | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rh.settings.local") | ||
from django.core.management import execute_from_command_line | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == "__main__": | ||
manage() |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -11,8 +11,8 @@ | |
author_email='[email protected]', | ||
url='https://github.com/rapidpro/rh/', | ||
packages=find_packages(), | ||
scripts=[ | ||
'scripts/manage.py' | ||
], | ||
entry_points={ | ||
"console_scripts": ["manage.py = rh.__main__:manage"], | ||
}, | ||
include_package_data=True, | ||
) |
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