-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add GitHub workflow to build Docker image
- Loading branch information
1 parent
3a54ea0
commit 90c8418
Showing
2 changed files
with
40 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,31 @@ | ||
name: Docker | ||
on: | ||
pull_request: {} | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Needed to fetch tags, used by Python install process to | ||
# figure out version number | ||
fetch-depth: 0 | ||
|
||
- uses: lsst-sqre/build-and-push-to-ghcr@v1 | ||
id: build | ||
with: | ||
image: "lsst/apdb-ppdb-replication" | ||
dockerfile: "docker/Dockerfile.replication" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
push: false | ||
|
||
- run: echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }} |
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
FROM python:3.12.1-slim-bookworm AS base-image | ||
FROM python:3.11.6-slim-bookworm AS base-image | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt pyproject.toml python/ . | ||
|
||
RUN apt-get update && apt-get -y install --no-install-recommends git | ||
RUN apt-get update | ||
RUN apt-get upgrade | ||
RUN apt-get -y install --no-install-recommends git | ||
RUN apt-get clean | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install --no-cache-dir --upgrade pip | ||
RUN pip install --no-cache-dir wheel | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
RUN pip install --no-cache-dir . | ||
|
||
ENTRYPOINT ["ppdb-replication", "run", "$CONFIG_APDB", "$CONFIG_PPDB"] |