Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

# Login to Quay.io and build image
docker login quay.io
docker build -t $REPO:$BRANCH .
docker build --build-arg GITHUB_SHA=$GITHUB_SHA -t $REPO:$BRANCH .

# Add 'latest' tag to 'main' image
if [[ $BRANCH == 'main' ]]; then
Expand Down
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
FROM python:3.12

WORKDIR /app
ARG GITHUB_SHA
ENV GITHUB_SHA=$GITHUB_SHA

ADD "https://api.github.com/repos/ACED-IDP/image_viewer/commits?per_page=1" latest_commit

RUN git clone https://github.com/ACED-IDP/image_viewer
WORKDIR /app/image_viewer
RUN git checkout development
RUN pip install --no-cache-dir .
RUN git log --oneline
# Copy the project files into the container
COPY pyproject.toml ./

RUN pip install .

# write git commit hash to a file
RUN echo $GITHUB_SHA > git_commit_hash.txt

# Copy the rest of the project files into the container
COPY . .

# Expose the port your app listens on
EXPOSE 8000

CMD ["uvicorn", "image_viewer.app:app", "--reload"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "image_viewer"
version = "0.1.0"
description = "A FastAPI project for viewing images"
authors = [
{ name = "Your Name", email = "your.email@example.com" }
{ name = "Brian Walsh", email = "walsbr@ohsu.edu" }
]
dependencies = [
"fastapi",
Expand Down