-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds a dockerfile and a ci build and push (#206)
* feat: adds a dockerfile and a ci build and push * docs: adds documentaion about docker usage
- Loading branch information
1 parent
91ee5b3
commit 684c142
Showing
4 changed files
with
106 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,44 @@ | ||
name: Docker build and publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/encord-active | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/encord-active:latest | ||
cache-to: type=inline |
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 @@ | ||
FROM python:3.9-slim | ||
|
||
ARG POETRY_VERSION="1.2.2" | ||
|
||
WORKDIR /app | ||
|
||
COPY .env pyproject.toml poetry.lock README.md /app | ||
COPY ./src/ /app/src | ||
|
||
ENV PYTHONPATH=${PYTHONPATH}:${PWD} | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
software-properties-common \ | ||
git \ | ||
ffmpeg | ||
|
||
RUN apt-get -y clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install . | ||
|
||
WORKDIR /data | ||
|
||
EXPOSE 8501 | ||
|
||
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 | ||
|
||
HEALTHCHECK CMD ecord-active --version | ||
ENTRYPOINT ["encord-active"] |
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