-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactored Dockerfile to simplify the base image declaration * Refactored Dockerfile to reduce number of layers
- Loading branch information
1 parent
045032b
commit c087582
Showing
1 changed file
with
5 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM alpine:3.21.2 AS builder | ||
FROM alpine:3.21.2 as base | ||
Check warning on line 1 in Dockerfile GitHub Actions / build (linux/amd64)The 'as' keyword should match the case of the 'from' keyword
Check warning on line 1 in Dockerfile GitHub Actions / build (linux/arm64)The 'as' keyword should match the case of the 'from' keyword
|
||
|
||
FROM base AS builder | ||
|
||
ARG TARGETPLATFORM | ||
|
||
|
@@ -22,7 +24,7 @@ RUN COLOUR='\e[1;93m' && \ | |
pip install -r /app/requirements.txt && \ | ||
echo -e "${COLOUR}Done.\e[0m" | ||
|
||
FROM alpine:3.21.2 | ||
FROM base AS runner | ||
LABEL maintainer="Patrick Baus <[email protected]>" | ||
LABEL description="Kraken sensor data aggregator." | ||
|
||
|
@@ -41,8 +43,7 @@ COPY --from=builder /opt/venv /opt/venv | |
# Enable venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
COPY --from=builder /app /app | ||
RUN chown -R worker:worker /app | ||
COPY --from=builder --chown=worker:worker /app /app | ||
|
||
USER worker | ||
|
||
|