Skip to content

Commit

Permalink
Create dedicated folder for containers and add base image
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorodskyi committed Feb 4, 2024
1 parent 8542270 commit f220d73
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Ignore git, data and cache files
.git
.github
.cache
.pytest_cache

__pycache__
/db
/tests
# Also ignore templates
/templates
6 changes: 3 additions & 3 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
file: Dockerfile
file: containers/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -103,7 +103,7 @@ jobs:
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
file: Dockerfile_${{ matrix.suffix }}
file: containers/Dockerfile_${{ matrix.suffix }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
dockerfile: 'Dockerfile'
dockerfile: 'containers/Dockerfile'
- uses: hadolint/[email protected]
with:
dockerfile: 'Dockerfile_dev'
dockerfile: 'containers/Dockerfile_dev'
- uses: hadolint/[email protected]
with:
dockerfile: 'Dockerfile_k8s'
dockerfile: 'containers/Dockerfile_k8s'
- uses: hadolint/[email protected]
with:
dockerfile: 'Dockerfile_k8s_dev'
dockerfile: 'containers/Dockerfile_k8s_dev'
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ codecov:

# Build containers
docker-container:
docker build . -t ${CONT_TAG}
docker build . -t ${CONT_TAG} -f containers/Dockerfile
podman-container:
podman build . -t ${CONT_TAG}
podman build . -t ${CONT_TAG} -f containers/Dockerfile
podman-container-devel:
podman build -f Dockerfile_dev -t pcw-devel
podman build . -f containers/Dockerfile_dev -t pcw-devel
podman-container-k8s:
podman build -f Dockerfile_k8s -t pcw-k8s-cleaner
podman build . -f containers/Dockerfile_k8s -t pcw-k8s-cleaner
podman-container-k8s-devel:
podman build -f Dockerfile_k8s_dev -t pcw-k8s-cleaner-devel
podman build . -f containers/Dockerfile_k8s_dev -t pcw-k8s-cleaner-devel

# Container linting
.PHONY: container-lint
container-lint: Dockerfile*
hadolint Dockerfile*
container-lint: containers/Dockerfile*
hadolint containers/Dockerfile*
7 changes: 2 additions & 5 deletions Dockerfile → containers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
FROM registry.suse.com/bci/python:3.11

ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 UWSGI_WSGI_FILE=/pcw/webui/wsgi.py UWSGI_MASTER=1
ENV UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy

## System preparation steps ################################################# ##

# We do the whole installation and configuration in one layer:
COPY requirements.txt /pcw/
# * Install system requirements
Expand Down Expand Up @@ -32,6 +27,8 @@ EXPOSE 8000/tcp

# Required to use system certs in python-requests
ENV REQUESTS_CA_BUNDLE=/etc/ssl/ca-bundle.pem
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 UWSGI_WSGI_FILE=/pcw/webui/wsgi.py UWSGI_MASTER=1
ENV UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy

# Once we are certain that this runs nicely, replace this with ENTRYPOINT.
ENTRYPOINT ["/pcw/container-startup", "run"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f220d73

Please sign in to comment.