Skip to content

Commit

Permalink
feat: example of docker labels REFS #64
Browse files Browse the repository at this point in the history
adds labels that are displayed by the github container registry
there are various other labels that the open container spec outlines
https://github.com/opencontainers/image-spec/blob/main/annotations.md\#pre-defined-annotation-keys

we should consider specifying values for the ones we think are useful
note that this is pending update on documentation
  • Loading branch information
devraj committed Apr 24, 2023
1 parent cb3557c commit 2dc0152
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ RUN poetry install --no-root
# uvicorn at this level so it sees the package
WORKDIR /opt/

# Labels are used to identify the image
LABEL org.opencontainers.image.source="https://github.com/anomaly/${PROJ_NAME}"
LABEL org.opencontainers.image.description="A Python web server using FastAPI and Uvicorn"
LABEL org.opencontainers.image.licenses="Apache-2.0"
6 changes: 4 additions & 2 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ COPY ./src/. .
# Expose ports which is proxied via traefik
EXPOSE 80

# ENTRYPOINT ["gunicorn", "--worker-tmp-dir=/dev/shm", "--worker-class=uvicorn.workers.UvicornWorker", "--bind=0.0.0.0:80", "labs.api:app"]
# CMD []
# Labels are used to identify the image
LABEL org.opencontainers.image.source="https://github.com/anomaly/${PROJ_NAME}"
LABEL org.opencontainers.image.description="A Python web server using FastAPI and Uvicorn"
LABEL org.opencontainers.image.licenses="Apache-2.0"

0 comments on commit 2dc0152

Please sign in to comment.