-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from mlexchange/actions-for-spin-deployment
Actions for spin deployment
- Loading branch information
Showing
4 changed files
with
89 additions
and
2 deletions.
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,45 @@ | ||
name: Create and publish image | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
tags: ['v*'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,18 @@ | ||
FROM python:3.9 | ||
|
||
# Create and set working directory | ||
WORKDIR /app | ||
|
||
# Install Python dependencies | ||
RUN python -m pip install --upgrade pip | ||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the remainder of the code into the image | ||
COPY . ./ | ||
|
||
EXPOSE 8075 | ||
# Run Dash app with gunicorn | ||
CMD ["gunicorn", "-b", "0.0.0.0:8075", "--reload", "app:server"] | ||
# Better than the alternative running of app.py directly with | ||
#CMD ["python", "app.py"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '3.7' | ||
|
||
services: | ||
app: | ||
container_name: highres_seg_demo | ||
build: . | ||
command: 'gunicorn -b 0.0.0.0:8075 --reload app:server' | ||
environment: | ||
TILED_URI: '${TILED_URI}' | ||
API_KEY: '${API_KEY}' | ||
volumes: | ||
- ./app.py:/app/app.py | ||
- ./callbacks:/app/callbacks | ||
- ./components:/app/components | ||
- ./utils:/app/utils | ||
ports: | ||
- '8075:8075' | ||
|
||
# networks: | ||
# - computing_api_default | ||
|
||
# networks: | ||
# computing_api_default: | ||
# external: true |