-
Notifications
You must be signed in to change notification settings - Fork 7
Feature/issue 178/build docker image #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
5ba30b0
e03801b
0f96721
870f32e
d79615b
8b4c49a
819ee24
d7120e9
10b4ab5
45da9d3
ea2ef03
97270cd
11354ac
8e808e2
f160266
2076d5f
8326a67
d4aebf3
d453f27
32bdd4d
b2e708b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Publish Docker image | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - v* | ||
|
|
||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| push_to_registry: | ||
| name: Push Docker image to Docker Hub | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out the repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| lfs: true | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
|
||
|
|
||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 | ||
| with: | ||
| images: cmidair/wristpy | ||
|
|
||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 | ||
| with: | ||
| platforms: linux/amd64,linux/arm64 | ||
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FROM python:3.11-buster | ||
|
|
||
| WORKDIR /app | ||
| COPY . /app/ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you make this copy more specific, or add a .dockerignore, to avoid copying unnecessary large files like the documentation pngs into the docker image? |
||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential \ | ||
| gfortran \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install poetry && \ | ||
| poetry config virtualenvs.create false && \ | ||
| poetry install --only main | ||
|
|
||
| RUN mkdir -p /data /output | ||
|
|
||
| ENTRYPOINT ["poetry", "run", "wristpy"] | ||
|
|
||
| CMD ["/data", "--output", "/output", "--output-filetype", ".csv", "--calibrator", "none", \ | ||
| "--activity-metric", "enmo", "--epoch-length", "5", "--nonwear-algorithm", "ggir"] | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.