Skip to content

Commit b3c7c85

Browse files
committed
Update Docker build workflow
1 parent 2c6998c commit b3c7c85

6 files changed

Lines changed: 34 additions & 27 deletions

File tree

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
build
22
dist
3+
pythonhere.egg-info
34
*.egg-info
45
*.egg/
56
*.pyc
67
*.swp
78

9+
.gitignore
810
.tox
911
.coverage
1012
html/*
@@ -13,3 +15,7 @@ __pycache__
1315
**/.git
1416
**/.buildozer
1517
**/.*
18+
**/.venv
19+
20+
midistream
21+
herethere

.github/workflows/push-docker.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,43 @@
11
on:
22
push:
33
tags:
4-
- '*'
4+
- "[0-9]*.[0-9]*.[0-9]*"
55

66
jobs:
77
docker:
8-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-22.04
99
steps:
10-
- uses: "actions/checkout@v2"
10+
- uses: "actions/checkout@v6"
1111

1212
- name: Set up QEMU
13-
uses: docker/setup-qemu-action@v1
13+
uses: docker/setup-qemu-action@v3
1414

1515
- name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v1
17-
18-
- name: Get the version
19-
id: version
20-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
16+
uses: docker/setup-buildx-action@v3
2117

2218
- name: Update version from tag
23-
env:
24-
VERSION: ${{ steps.version.outputs.VERSION }}
2519
run: |
20+
VERSION="${GITHUB_REF_NAME}"
2621
echo "Version is: ${VERSION}"
27-
test -n "${VERSION}"
22+
[[ "${VERSION}" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]
2823
echo "__version__ = \"${VERSION}\"" > pythonhere/version_here.py
2924
3025
- name: Login to DockerHub
31-
uses: docker/login-action@v1
26+
uses: docker/login-action@v3
3227
with:
3328
username: ${{ secrets.DOCKER_USERNAME }}
3429
password: ${{ secrets.DOCKER_TOKEN }}
3530

3631
- name: Build and push
3732
id: docker_build
38-
uses: docker/build-push-action@v2
33+
uses: docker/build-push-action@v6
3934
with:
4035
context: .
4136
file: ./Dockerfile
4237
push: true
4338
tags: |
44-
"herethere/pythonhere:latest"
45-
"herethere/pythonhere:${{ steps.version.outputs.VERSION }}"
39+
herethere/pythonhere:latest
40+
herethere/pythonhere:${{ github.ref_name }}
4641
4742
- name: Image digest
4843
run: echo ${{ steps.docker_build.outputs.digest }}

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
FROM jupyter/base-notebook:python-3.8.6
1+
FROM quay.io/jupyter/base-notebook:python-3.13
22

3-
COPY . /src
4-
COPY examples /home/${NB_USER}/examples
3+
COPY --chown=${NB_USER}:users . /home/${NB_USER}/src
4+
COPY --chown=${NB_USER}:users examples /home/${NB_USER}/examples
55

6-
RUN cd /src && pip install .[dev,docker]
6+
RUN cd /home/${NB_USER}/src && \
7+
python -m pip install --upgrade pip && \
8+
python -m pip install . --group docker && \
9+
python -m pip check
710

8-
USER root
911
RUN cd /home/${NB_USER}/examples && \
1012
jupytext --to ipynb *.md && \
1113
rm *.md && \
12-
chown -R ${NB_USER} \
13-
/usr/local/bin/fix-permissions /home/${NB_USER}/examples &&\
1414
rm -rf /home/${NB_USER}/.cache && \
15-
rm -rf /src
15+
rm -rf /home/${NB_USER}/src

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ Example command to start the Docker container::
5555
docker run \
5656
--rm \
5757
-p 8888:8888 \
58+
--user root \
59+
-e CHOWN_EXTRA=/home/jovyan/work \
60+
-e CHOWN_EXTRA_OPTS='-R' \
5861
-v "$(pwd)/work":/home/jovyan/work \
5962
herethere/pythonhere:latest
6063

docker-compose.yml.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ services:
77
# build: .
88
ports:
99
- 8888:8888
10+
user: root
11+
environment:
12+
- CHOWN_EXTRA=/home/jovyan/work
13+
- CHOWN_EXTRA_OPTS=-R
1014
# Uncomment and fill in environment, to override values from there.env config
11-
# environment:
1215
# - THERE_HOST=
1316
# - THERE_PORT=8022
1417
# - THERE_USER=

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.14",
2323
]
2424
dependencies = [
25-
"herethere>=0.1.0",
25+
"herethere[magic]>=0.1.0",
2626
"ipython",
2727
"ipywidgets",
2828
"Pillow",
@@ -47,7 +47,7 @@ dev = [
4747
"twine",
4848
]
4949
docker = [
50-
"jupytext==1.7.1",
50+
"jupytext==1.19.3",
5151
]
5252

5353
[project.urls]

0 commit comments

Comments
 (0)