Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Performance Improvement #128

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 11 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
workflow "CI" {
on = "push"
resolves = [
"Dockerfile lint"
]
}

action "Dockerfile lint" {
uses = "docker://cdssnc/docker-lint"
args = "--ignore DL3013"
}
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
MAINTAINER David Buckley <[email protected]>
FROM python:3.5 as python-base
LABEL Description="Track Web Security Compliance" Vendor="Canadian Digital Service"

FROM python:3.5 as python-base
COPY requirements.txt /opt/track-web/requirements.txt
COPY setup.py /opt/track-web/setup.py
COPY track /opt/track-web/track
COPY MANIFEST.in /opt/track-web/MANIFEST.in

# Build wheels to install into production image
# Force a build with --no-binary to get around the case where a wheel is available for python:3.5 but not python:3.5-alpine
RUN pip install --upgrade pip && mkdir wheels && pip wheel --no-binary :all: -r /opt/track-web/requirements.txt -w wheels && pip wheel --no-deps /opt/track-web/ -w wheels

FROM python:3.5-alpine
MAINTAINER David Buckley <[email protected]>
LABEL Description="Track Digital Security Compliance" Vendor="Canadian Digital Service"

COPY --from=python-base /wheels /wheels

RUN pip install /wheels/* && rm -rf /wheels /root/.cache/pip && \
addgroup -S track-web && adduser -S -G track-web track-web && \
addgroup --system track-web && adduser --system --group track-web && \
mkdir -p /opt/track-web/.cache && \
chown -R track-web /opt/track-web

USER track-web:track-web

EXPOSE 5000
Expand Down
7 changes: 0 additions & 7 deletions Dockerfile.build

This file was deleted.

8 changes: 0 additions & 8 deletions docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion track/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class Config:
DEBUG = False
TESTING = False
MONGO_URI = "mongodb://localhost:27017/track"
MONGO_URI = os.environ.get("TRACKER_MONGO_URI", "mongodb://localhost:27017/track")
CACHE_TYPE = "null"

@staticmethod
Expand Down
2 changes: 2 additions & 0 deletions track/static/js/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var Tables = {

// add common options to all renderTables requests
if (!options.responsive) options.responsive = true;
if (!options.deferRender) options.deferRender = true; // Older browsers need this to load in an acceptable time frame. We may want to make it conditional in the future


var customInit = function() {}; // noop
if (options.initComplete) customInit = options.initComplete;
Expand Down