-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add Dockerfile and workflow to push to DockerHub (#150)
* add Dockerfile and wf for pushing to DockerHub * add parent directory in Dockerfile to mount pre-loaded digest data * update README * fix sneaky typo detected by codespell
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build and push image to DockerHub | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/digest:nightly |
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,15 @@ | ||
FROM python:3.10 | ||
|
||
# Create parent directory to have a place to mount pre-loaded digest files (currently the nipoppy-qpn repo) | ||
# TODO: Revisit this with longer-term solution to handle available digests (e.g., QPN as submodule?) | ||
WORKDIR /app/code | ||
|
||
COPY ./requirements.txt /app/code/requirements.txt | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir --upgrade -r /app/code/requirements.txt | ||
|
||
COPY ./digest /app/code/digest | ||
COPY ./schemas /app/code/schemas | ||
|
||
CMD ["gunicorn", "digest.app:server", "-b", "0.0.0.0:8050", "--workers", "4", "--threads", "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
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