Skip to content

Commit

Permalink
WIP: Add GitHub workflow to build Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMcCormick committed Sep 20, 2024
1 parent 3a54ea0 commit 90c8418
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docker.yaml
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 }}
11 changes: 9 additions & 2 deletions docker/Dockerfile.replication
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"]

0 comments on commit 90c8418

Please sign in to comment.