Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8
FROM registry.access.redhat.com/ubi8:8.3

WORKDIR /app

Expand All @@ -17,4 +17,8 @@ USER 1001

COPY . /app
ENV FLASK_APP=server/__init__.py
CMD ["python3", "manage.py", "start", "0.0.0.0:3000"]
ENV PORT 3000

EXPOSE 3000

CMD ["python3", "manage.py", "start"]
34 changes: 30 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ Running Flask applications has been simplified with a `manage.py` file to avoid
pipenv install
```

To run your application locally:
Then, activate this app's virtualenv:

```bash
pipenv shell
```

To run your application locally, run this inside the virtualenv:

```bash
python manage.py start
Expand Down
9 changes: 6 additions & 3 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import os, sys, argparse, subprocess, signal

# Tip from:
# https://github.com/dpgaspar/Flask-AppBuilder/issues/733#issuecomment-379009480
PORT = int(os.environ.get("PORT", 3000))

# Project defaults
FLASK_APP = 'server/__init__.py'
DEFAULT_IP = '0.0.0.0:3000'

DEFAULT_IP = '0.0.0.0:' + str(PORT)

class Command:
def __init__(self, name, descr, runcmd, env={}):
Expand Down Expand Up @@ -99,7 +102,7 @@ def availableCommands(self):
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("subcommand", help="subcommand to run (see list above)")
parser.add_argument("ipaddress", nargs='?', default=DEFAULT_IP,
help="address and port to run on (i.e. {0})".format(DEFAULT_IP))
help="address and port to run on (i.e. 0.0.0.0:3000)")


def livereload_check():
Expand Down