Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/node-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
test-node-22:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.2

- name: Check node-22/node-base.Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: node-22/node-base.Dockerfile

- name: Check node-22/node-dev.Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: node-22/node-dev.Dockerfile

- name: Check examples/node-22/Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: examples/node-22/Dockerfile

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/node-24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
test-node-24:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.2

- name: Check node-24/node-base.Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: node-24/node-base.Dockerfile

- name: Check node-24/node-dev.Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: node-24/node-dev.Dockerfile

- name: Check examples/node-24/Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: examples/node-24/Dockerfile

Expand Down
38 changes: 4 additions & 34 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
timeout-minutes: 10
steps:
- name: Login to Quay.io
uses: docker/login-action@v2
uses: docker/login-action@v3.7.0
with:
registry: quay.io
username: ${{ secrets.QUAY_ID }}
password: ${{ secrets.QUAY_PW }}

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6.0.2

- name: Build node container
run: |
Expand All @@ -43,14 +43,14 @@ jobs:
timeout-minutes: 10
steps:
- name: Login to Quay.io
uses: docker/login-action@v2
uses: docker/login-action@v3.7.0
with:
registry: quay.io
username: ${{ secrets.QUAY_ID }}
password: ${{ secrets.QUAY_PW }}

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6.0.2

- name: Build node container
run: |
Expand All @@ -67,33 +67,3 @@ jobs:
docker push quay.io/mynth/node:24-base-$TAG
docker push quay.io/mynth/node:24-dev-$TAG
if: github.ref == 'refs/heads/main'

publish-python:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_ID }}
password: ${{ secrets.QUAY_PW }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Build python container
run: |
make build-python-base
make build-python-dev

- name: Publish container
run: |
TAG=$(git rev-parse --short HEAD)
docker tag quay.io/mynth/python:base quay.io/mynth/python:base-$TAG
docker tag quay.io/mynth/python:dev quay.io/mynth/python:dev-$TAG
docker push quay.io/mynth/python:base
docker push quay.io/mynth/python:dev
docker push quay.io/mynth/python:base-$TAG
docker push quay.io/mynth/python:dev-$TAG
if: github.ref == 'refs/heads/main'
50 changes: 0 additions & 50 deletions .github/workflows/python.yml

This file was deleted.

12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
all: node-22 python
all: node-22 node-24
node-22: build-node-22-base build-node-22-dev build-node-22-example
node-24: build-node-24-base build-node-24-dev build-node-24-example
python: build-python-base build-python-dev build-python-example

build-node-22-base:
docker build -t quay.io/mynth/node:22-base -f node-22/node-base.Dockerfile node-22
Expand All @@ -20,12 +19,3 @@ build-node-24-dev:

build-node-24-example:
docker build -t node-24-example examples/node-24

build-python-base:
docker build -t quay.io/mynth/python:base -f python/python-base.Dockerfile python

build-python-dev:
docker build -t quay.io/mynth/python:dev -f python/python-dev.Dockerfile python

build-python-example:
docker build -t python-example examples/python
65 changes: 0 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,71 +77,6 @@ docker run -p 3000:3000 node-example
If you follow the example provided in [examples/node](examples/node),
you can access the running web application at `http://localhost:3000/`.

## Python

The `python` image is a lightweight and optimized container for running
Python applications that use `poetry`. It comes with Python 3.11
installed.

### Usage

To use the `python` image, create a `Dockerfile` in your project
directory that utilizes the multi-stage feature of Docker. The first
stage will build your application, and the second stage will copy the
built files for deployment. This results in a lightweight container
image.

The first part of the container will use the `dev` tag to build the
application:

``` dockerfile
FROM quay.io/mynth/python:dev as builder

COPY poetry.lock pyproject.toml /app/
RUN install-poetry-app hello_python
```

The `install-poetry-app` script helps install your application. First,
copy your `poetry.lock` and `pyproject.toml` to the `/app/` directory,
then call `install-poetry-app` with the name of your application.

Now that your application is built, you can copy the built files to the
image with the `base` tag:

``` dockerfile
FROM quay.io/mynth/python:base

COPY --from=builder /app /app
COPY hello_python /app/hello_python
```

Copy the files from the `/app` directory in your builder container, as
well as all the source code files from your local repository.

Now your application is ready to run, so you can include a command and
expose any necessary ports:

``` dockerfile
EXPOSE 8000
CMD ["uvicorn", "--host", "0.0.0.0", "hello_python.app:app"]
```

Build the Dockerfile as usual:

``` bash
docker build -t python-example .
```

Now your application can be run:

``` bash
docker run -p 8000:8000 python-example
```

If you follow the example provided in
[examples/python](examples/python), you’ll be able to access the running
web application at `http://localhost:8000/`.

## Embracing Ubuntu as the Ideal Base for Container Images

In the world of containerization, choosing the right base image is
Expand Down
36 changes: 0 additions & 36 deletions examples/python/.dockerignore

This file was deleted.

14 changes: 0 additions & 14 deletions examples/python/Dockerfile

This file was deleted.

Empty file.
8 changes: 0 additions & 8 deletions examples/python/hello_python/app.py

This file was deleted.

Loading