diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 59770d0b..b82490ff 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,3 +24,10 @@ jobs: image: ${{ github.repository }}-hinfo github_token: ${{ secrets.GITHUB_TOKEN }} dockerfile: Dockerfile.hinfo + + - name: Build pqserver + uses: lsst-sqre/build-and-push-to-ghcr@v1 + with: + image: ${{ github.repository }}-pq + github_token: ${{ secrets.GITHUB_TOKEN }} + dockerfile: Dockerfile.pqserver diff --git a/Dockerfile.pqserver b/Dockerfile.pqserver index 9c2dd9c5..6a7d7300 100644 --- a/Dockerfile.pqserver +++ b/Dockerfile.pqserver @@ -1,8 +1,12 @@ FROM python:3.11 -RUN pip install flask gunicorn sqlalchemy -WORKDIR /consdb-server -COPY src/server.py /consdb-server/ +RUN pip install flask gunicorn sqlalchemy psycopg2 +WORKDIR /consdb-pq +COPY python/lsst/consdb/pqserver.py python/lsst/consdb/utils.py /consdb-pq/ # Environment variables that must be set: -# POSTGRES_URL -ENTRYPOINT [ "gunicorn", "-b", "0.0.0.0:8000", "-w", "2", "server:app" ] +# DB_HOST DB_PASS DB_USER DB_NAME or POSTGRES_URL + +# Expose the port. +EXPOSE 8080 + +ENTRYPOINT [ "gunicorn", "-b", "0.0.0.0:8080", "-w", "2", "pqserver:app" ]