-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1707 from Crown-Commercial-Service/GMBP-231-add-n…
…ative-build Add build for native AWS container image support
- Loading branch information
Showing
7 changed files
with
62 additions
and
0 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
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 @@ | ||
# Add an unauthenticated /healthcheck route for ECS Task & ALB Target | ||
# Group health checks. Simply indicates that the app is "up". | ||
from flask import Blueprint, jsonify | ||
|
||
healthcheck = Blueprint('healthcheck', __name__, url_prefix='/healthcheck') | ||
|
||
|
||
@healthcheck.route('/') | ||
@healthcheck.route('') | ||
def healthcheck_root(): | ||
return jsonify(status='ok'), 200 |
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,5 @@ | ||
# Base builds are defined in https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-aws-docker-base | ||
FROM digitalmarketplace/dmp-http-buildstatic:1.0.0 as buildstatic | ||
|
||
FROM digitalmarketplace/dmp-http-frontend:1.0.0 | ||
COPY --from=buildstatic ${APP_DIR}/app/static ${APP_DIR}/static |
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,8 @@ | ||
# Base builds are defined in https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-aws-docker-base | ||
FROM digitalmarketplace/dmp-http-buildstatic:1.0.0 as buildstatic | ||
|
||
FROM digitalmarketplace/dmp-wsgi:1.0.0 | ||
COPY --from=buildstatic ${APP_DIR}/node_modules/digitalmarketplace-govuk-frontend ${APP_DIR}/node_modules/digitalmarketplace-govuk-frontend | ||
COPY --from=buildstatic ${APP_DIR}/node_modules/govuk-frontend ${APP_DIR}/node_modules/govuk-frontend | ||
COPY --from=buildstatic ${APP_DIR}/app/content ${APP_DIR}/app/content | ||
COPY --from=buildstatic ${APP_DIR}/app/static ${APP_DIR}/app/static |
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,13 @@ | ||
# docker-aws | ||
|
||
Changes to the Docker build process for the 2023 AWS native migration. | ||
|
||
## Explanation | ||
|
||
The DMP1.5 (and 1.0) task architecture is as follows: a Supervisord task which runs Nginx, uWSGI and awslogs. Some points about this: | ||
|
||
We do not require an awslogs router task anymore, rather just to write the logs to stdout / stderr and let Docker and the ECS-included awslogs driver route these naturally to CloudWatch Logs | ||
|
||
Supervisord is a poor task manager for an ECS task because it maintains the perception of a healthy container even when a sub-process (e.g. uWSGI) has died (zombie tasks are pretty common in this case) | ||
|
||
We must therefore arrive at an alternative architecture for the ECS Tasks and a change of Docker build process to support this. Please see ticket and code changes for [GMBP-195](https://crowncommercialservice.atlassian.net/browse/GMBP-195) for a more detailed explanation. |