Simplify sqkserver docker (#327)

* Simplify sqkserver docker by copying entire repository to image

* Got flask templates working without custom root path

* Remove unused comment in setup.py
This commit is contained in:
Jonathan Zernik 2020-10-27 01:04:48 -04:00 committed by GitHub
parent 5c4bfbc076
commit 287d0f34ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View file

@ -19,12 +19,14 @@ WORKDIR /app
RUN git clone https://github.com/googleapis/googleapis.git
# Copy the source code.
COPY squeakserver ./squeakserver
COPY proto ./proto
COPY setup.py setup.cfg MANIFEST.in README.md ./
COPY . ./
# COPY proto files
RUN cp -r proto/ squeakserver/proto
# Copy the frontend build
COPY frontend/squeak-node-frontend/build/ ./static/build
RUN mkdir ./static && \
cp -r frontend/squeak-node-frontend/build/ ./static/build
RUN python3 setup.py install

View file

@ -28,9 +28,9 @@ logger = logging.getLogger(__name__)
def create_app(handler, username, password):
# create and configure the app
logger.info("Starting flask app from directory: {}".format(os.getcwd()))
root_path = 'squeakserver/admin/webapp'
# root_path = 'squeakserver/admin/webapp'
# root_path = os.path.dirname(os.path.realpath(__file__))
logger.info("Starting flask with root_path: {}".format(root_path))
#logger.info("Starting flask with root_path: {}".format(root_path))
# readme = open("README.md", "r").read()
# logger.info("Starting flask with README: {}".format(readme))
# base_template = open("squeakserver/admin/webapp/templates/base.html", "r").read()
@ -39,8 +39,8 @@ def create_app(handler, username, password):
__name__,
static_folder='/app/static/build',
static_url_path='/',
template_folder='templates',
root_path=root_path,
# template_folder='templates',
# root_path=root_path,
)
app.config.from_mapping(
SECRET_KEY='dev',

View file