-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failing regoval tests due to Dockerfile in .gitignore
Signed-off-by: Santosh <[email protected]>
- Loading branch information
1 parent
a08b817
commit 884f56a
Showing
5 changed files
with
44 additions
and
4 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 |
---|---|---|
|
@@ -12,3 +12,4 @@ cosign | |
!.devcontainer/Dockerfile | ||
results.json | ||
.env | ||
!pkg/validate/testdata/Dockerfile/ |
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
File renamed without changes.
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
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,42 @@ | ||
# Stage 1: Build the application | ||
FROM cgr.dev/chainguard/wolfi-base AS builder | ||
|
||
RUN --no-cache apk update && apk add python-3.11 && \ | ||
apk add py3.11-pip --no-cache | ||
USER nonroot | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
EXPOSE 22 | ||
USER nonroot | ||
|
||
WORKDIR /app | ||
|
||
COPY --chown=nonroot:nonroot requirements.txt /app/requirements.txt | ||
|
||
RUN pip install -r /app/requirements.txt --user | ||
|
||
|
||
# Stage 2: Copy the venv and run the application | ||
FROM cgr.dev/chainguard/wolfi-base AS final | ||
|
||
RUN --no-cache apk update && apk add python-3.11 && \ | ||
apk add py3.11-pip | ||
|
||
RUN pip install --upgrade pip setuptools | ||
|
||
USER nonroot | ||
|
||
WORKDIR /app | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
COPY --chown=nonroot:nonroot . . | ||
|
||
COPY --from=builder --chown=nonroot:nonroot /home/nonroot/.local /home/nonroot/.local | ||
|
||
ENV PATH=/home/nonroot/.local/bin:$PATH | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["uvicorn", "main:app","--host", "0.0.0.0","--port", "8000"] |