This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
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.
Merge pull request #2 from communitiesuk/fs-4462-base-image-build
Fs 4462 base image build
- Loading branch information
Showing
9 changed files
with
373 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
# Pyre type checker | ||
.pyre/ | ||
|
||
sqlite.db | ||
|
||
.idea | ||
.DS_Store |
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 |
---|---|---|
@@ -1,2 +1,16 @@ | ||
# funding-service-design-base | ||
Base images and requirements definitions for funding service design apps | ||
Base images and requirements definitions for development of funding service design apps. These images are not used in production as those ones are build using Paketo. | ||
|
||
## Python Flask Dev | ||
Contains requirements files for different versions of a python flask app. The [Dockerfile](./python-flask-dev/Dockerfile) contains the following build targets: | ||
- `flask`: Developer image based on python 3.10 bullseye, with Flask 3.0.3 installed on top, plus everything in [requirements-dev.txt](./python-flask-dev/requirements-dev.txt) | ||
- `frontend`: Base on `flask` above, with everything from [requirements-frontend.txt](./python-flask-dev/requirements-frontend.txt) installed | ||
|
||
## Workflows | ||
- [Publish](/.github/workflows/publish.yml): Uses a matrix strategy to build each target in the Dockerfile and publish these to GHCR. If on `main`, will tag them as specified in [tags](./python-flask-dev/tags). (At present if you add something to tags you also need to add to [publish.yml](./.github/workflows/publish.yml)). | ||
|
||
# Future Improvements | ||
- Make the workflow just use all tags in the tags file, not hard code them? | ||
- If we add other base images besides [python-flask-dev](./python-flask-dev/), make the workflow use a matrix approach so it builds all of these? | ||
- Are we using the right tag names? | ||
- Stop using pip-compile and use rye? |
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 |
---|---|---|
@@ -1,17 +1,32 @@ | ||
FROM python:3.10-bullseye as fsd-base-dev-python-flask | ||
|
||
# -------------------------------------------------- | ||
# Basic python flask image that the other FSD images can build upon | ||
# -------------------------------------------------- | ||
|
||
FROM python:3.10-bullseye as flask | ||
WORKDIR /app | ||
COPY requirements.txt requirements.txt | ||
COPY requirements-dev.txt requirements-dev.txt | ||
RUN pip install --upgrade pip && pip install -r requirements.txt | ||
RUN pip install -r requirements-dev.txt | ||
RUN pip install pip-tools | ||
|
||
FROM fsd-base-dev-python-flask as frontend | ||
# -------------------------------------------------- | ||
# Base image to build frontend applications on - includes flask and other frontend frameworks such as govuk-frontend-jinja | ||
# -------------------------------------------------- | ||
|
||
FROM flask as frontend | ||
WORKDIR /app | ||
COPY requirements-frontend.txt requirements-frontend.txt | ||
RUN pip install --upgrade pip && pip install -r requirements-frontend.txt | ||
|
||
FROM fsd-base-dev-python-flask as db | ||
WORKDIR /app | ||
COPY requirements-frontend.txt requirements-db.txt | ||
RUN pip install --upgrade pip && pip install -r requirements-db.txt | ||
|
||
|
||
# -------------------------------------------------- | ||
# Will hold config for building DB base image | ||
# -------------------------------------------------- | ||
|
||
# FROM flask as db | ||
# WORKDIR /app | ||
# COPY requirements-db.txt requirements-db.txt | ||
# RUN pip install --upgrade pip && pip install -r requirements-db.txt |
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,24 @@ | ||
#----------------------------------- | ||
# Pytest | ||
#----------------------------------- | ||
|
||
pytest==8.2.2 | ||
pytest-mock==3.12.0 | ||
pytest-env==1.1.3 | ||
|
||
#----------------------------------- | ||
# Dev Utils | ||
#----------------------------------- | ||
invoke==2.2.0 | ||
|
||
#----------------------------------- | ||
# Code Quality | ||
#----------------------------------- | ||
flake8==7.0.0 | ||
flake8-pyproject==1.2.3 | ||
black==24.3.0 | ||
|
||
#----------------------------------- | ||
# Other Dev Dependencies | ||
#----------------------------------- | ||
beautifulsoup4==4.12.2 |
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,61 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.10 | ||
# by the following command: | ||
# | ||
# pip-compile requirements-dev.in | ||
# | ||
beautifulsoup4==4.12.2 | ||
# via -r requirements-dev.in | ||
black==24.3.0 | ||
# via -r requirements-dev.in | ||
click==8.1.7 | ||
# via black | ||
exceptiongroup==1.2.1 | ||
# via pytest | ||
flake8==7.0.0 | ||
# via | ||
# -r requirements-dev.in | ||
# flake8-pyproject | ||
flake8-pyproject==1.2.3 | ||
# via -r requirements-dev.in | ||
iniconfig==2.0.0 | ||
# via pytest | ||
invoke==2.2.0 | ||
# via -r requirements-dev.in | ||
mccabe==0.7.0 | ||
# via flake8 | ||
mypy-extensions==1.0.0 | ||
# via black | ||
packaging==24.1 | ||
# via | ||
# black | ||
# pytest | ||
pathspec==0.12.1 | ||
# via black | ||
platformdirs==4.2.2 | ||
# via black | ||
pluggy==1.5.0 | ||
# via pytest | ||
pycodestyle==2.11.1 | ||
# via flake8 | ||
pyflakes==3.2.0 | ||
# via flake8 | ||
pytest==8.2.2 | ||
# via | ||
# -r requirements-dev.in | ||
# pytest-env | ||
# pytest-mock | ||
pytest-env==1.1.3 | ||
# via -r requirements-dev.in | ||
pytest-mock==3.12.0 | ||
# via -r requirements-dev.in | ||
soupsieve==2.5 | ||
# via beautifulsoup4 | ||
tomli==2.0.1 | ||
# via | ||
# black | ||
# flake8-pyproject | ||
# pytest | ||
# pytest-env | ||
typing-extensions==4.12.2 | ||
# via black |
Oops, something went wrong.