File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Create and publish a Docker image (with profiles)
2+
3+ on :
4+ release :
5+ types : [published]
6+ workflow_dispatch :
7+
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : ${{ github.repository }}-profiles
11+
12+ jobs :
13+ build-and-push-image :
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ packages : write
18+ attestations : write
19+ id-token : write
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v4
23+
24+ - name : Log in to the Container registry
25+ uses : docker/login-action@v3
26+ with :
27+ registry : ${{ env.REGISTRY }}
28+ username : ${{ github.actor }}
29+ password : ${{ secrets.GITHUB_TOKEN }}
30+
31+ - name : Extract metadata (tags, labels) for Docker
32+ id : meta
33+ uses : docker/metadata-action@v5
34+ with :
35+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36+
37+ - name : Build and push Docker image
38+ id : push
39+ uses : docker/build-push-action@v6
40+ with :
41+ context : .
42+ file : ./Dockerfile.profiles
43+ push : true
44+ tags : ${{ steps.meta.outputs.tags }}
45+ labels : ${{ steps.meta.outputs.labels }}
46+
47+ - name : Generate artifact attestation
48+ uses : actions/attest-build-provenance@v2
49+ with :
50+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
51+ subject-digest : ${{ steps.push.outputs.digest }}
52+ push-to-registry : true
Original file line number Diff line number Diff line change 1+ FROM python:3.11-slim
2+
3+ # Install required system packages, including git
4+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
5+
6+ WORKDIR /app
7+
8+ COPY requirements.txt .
9+ RUN pip install --upgrade pip
10+ RUN pip install --no-cache-dir -r requirements.txt
11+
12+ COPY cratey.py LICENSE /app/
13+ COPY app /app/app
14+ COPY tests/data/rocrate_validator_profiles /app/profiles
15+
16+ RUN useradd -ms /bin/bash flaskuser
17+ RUN chown -R flaskuser:flaskuser /app
18+
19+ ENV PROFILES_PATH=/app/profiles
20+
21+ USER flaskuser
22+
23+ EXPOSE 5000
24+
25+ CMD ["flask", "run", "--host=0.0.0.0"]
26+
27+ LABEL org.opencontainers.image.source="https://github.com/eScienceLab/Cratey-Validator"
You can’t perform that action at this time.
0 commit comments