-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change dockerfile due to moving to pyproject
- Loading branch information
Showing
7 changed files
with
69 additions
and
29 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,9 +1,22 @@ | ||
# cache and dot files | ||
.eggs/ | ||
./deployment/containers/ | ||
.venv/ | ||
.mypy_cache/ | ||
.pytest_cache/ | ||
.coverage/ | ||
.ruff/ | ||
.ruff_cache/ | ||
.eggs/ | ||
.eggs/ | ||
.github/ | ||
.gitignore | ||
# Docs and atifacts | ||
./deployment | ||
./docs | ||
/images | ||
# build | ||
./build | ||
./dist | ||
# Scripts and tools | ||
./scripts | ||
Makefile | ||
PULL_REQUEST_TEMPLATE.md |
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,25 +1,39 @@ | ||
# Builder: produce wheels | ||
################################################### | ||
# Stage 1: Build wheel # | ||
################################################### | ||
FROM python:3.11-alpine AS builder | ||
|
||
FROM alpine:3.10 as builder | ||
# Set work directory | ||
WORKDIR /app | ||
|
||
RUN apk add --no-cache python3 | ||
RUN apk add --no-cache git | ||
RUN python3 -m pip install --upgrade setuptools pip wheel | ||
# Install poetry | ||
RUN pip install poetry | ||
|
||
WORKDIR /app/ | ||
# Copy source code | ||
COPY . . | ||
|
||
RUN python3 setup.py bdist_wheel | ||
# Build wheel | ||
RUN poetry build -f wheel | ||
|
||
# Install: copy tesk-core*.whl and install it with dependencies | ||
################################################### | ||
# Stage 2: Install wheel and create user # | ||
################################################### | ||
FROM python:3.11-alpine AS runner | ||
|
||
FROM alpine:3.10 | ||
# Copy built wheel from the builder stage | ||
COPY --from=builder /app/dist/*.whl /dist/ | ||
|
||
RUN apk add --no-cache python3 | ||
# Install the application with dependencies | ||
RUN pip install /dist/*.whl | ||
|
||
COPY --from=builder /app/dist/tesk*.whl /root/ | ||
RUN python3 -m pip install --disable-pip-version-check --no-cache-dir /root/tesk*.whl | ||
# Create a non-root user | ||
RUN adduser -D -u 1000 filerUser | ||
|
||
USER 100 | ||
# Switch to the non-root user | ||
USER filerUser | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Entrypoint command | ||
ENTRYPOINT ["filer"] |
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,26 +1,39 @@ | ||
# Builder: produce wheels | ||
################################################### | ||
# Stage 1: Build wheel # | ||
################################################### | ||
FROM python:3.11-alpine AS builder | ||
|
||
FROM alpine:3.10 as builder | ||
# Set work directory | ||
WORKDIR /app | ||
|
||
RUN apk add --no-cache python3 | ||
RUN apk add --no-cache git | ||
RUN python3 -m pip install --upgrade setuptools pip wheel | ||
# Install poetry | ||
RUN pip install poetry | ||
|
||
WORKDIR /app/ | ||
# Copy source code | ||
COPY . . | ||
|
||
RUN python3 setup.py bdist_wheel | ||
# Build wheel | ||
RUN poetry build -f wheel | ||
|
||
# Install: copy tesk-core*.whl and install it with dependencies | ||
################################################### | ||
# Stage 2: Install wheel and create user # | ||
################################################### | ||
FROM python:3.11-alpine AS runner | ||
|
||
FROM alpine:3.10 | ||
# Copy built wheel from the builder stage | ||
COPY --from=builder /app/dist/*.whl /dist/ | ||
|
||
RUN apk add --no-cache python3 | ||
# Install the application with dependencies | ||
RUN pip install /dist/*.whl | ||
|
||
COPY --from=builder /app/dist/tesk*.whl /root/ | ||
RUN python3 -m pip install --disable-pip-version-check --no-cache-dir /root/tesk*.whl | ||
# Create a non-root user | ||
RUN adduser -D -u 1000 taskmasterUser | ||
|
||
RUN adduser --uid 100 -S taskmaster | ||
USER 100 | ||
# Switch to the non-root user | ||
USER taskmasterUser | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Entrypoint command | ||
ENTRYPOINT ["taskmaster"] |
File renamed without changes.
Empty file.
Empty file.
Empty file.