Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 4 additions & 2 deletions backend/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.13.3-alpine AS builder
RUN apk update && \
addgroup -S owasp && \
adduser -S -h /home/owasp -G owasp owasp && \
python -m pip install --no-cache-dir poetry
python -m pip install poetry

ENV POETRY_VIRTUALENVS_IN_PROJECT=true \
PYTHONUNBUFFERED=1
Expand All @@ -13,7 +13,8 @@ WORKDIR /home/owasp
USER owasp

COPY --chmod=444 --chown=owasp:owasp poetry.lock pyproject.toml ./
RUN poetry install --no-root --without dev --without test
RUN --mount=type=cache,target=/root/.cache/pypotery \
poetry install --no-root --without dev --without test
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

COPY apps apps
COPY docker/entrypoint.sh entrypoint.sh
Expand All @@ -33,6 +34,7 @@ ENV PATH="/home/owasp/.venv/bin:$PATH" \

WORKDIR /home/owasp

COPY --from=builder --chmod=755 --chown=owasp:owasp /home/owasp/.venv /home/owasp/.venv
COPY --from=builder --chmod=555 --chown=owasp:owasp /home/owasp /home/owasp
RUN chmod +x /home/owasp/entrypoint.sh

Expand Down
8 changes: 5 additions & 3 deletions backend/docker/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SHELL ["/bin/sh", "-o", "pipefail", "-c"]
RUN apk update && apk upgrade && \
addgroup -S owasp && \
adduser -S -h /home/owasp -G owasp owasp && \
python -m pip install --no-cache-dir poetry
python -m pip install poetry

ENV POETRY_VIRTUALENVS_IN_PROJECT=true \
PYTHONUNBUFFERED=1
Expand All @@ -13,7 +13,8 @@ USER owasp
WORKDIR /home/owasp

COPY --chmod=444 --chown=owasp:owasp poetry.lock pyproject.toml ./
RUN poetry install --no-root --without dev --without test
RUN --mount=type=cache,target=/root/.cache/pypotery \
poetry install --no-root --without dev --without test
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

FROM python:3.13.3-alpine

Expand All @@ -23,7 +24,7 @@ RUN apk update && \
apk add postgresql-client redis && \
addgroup -S owasp && \
adduser -S -h /home/owasp -G owasp owasp && \
python -m pip install --no-cache-dir poetry
python -m pip install poetry

ENV PATH="/home/owasp/.venv/bin:$PATH" \
PYTHONUNBUFFERED=1
Expand All @@ -33,4 +34,5 @@ EXPOSE 8000
USER owasp
WORKDIR /home/owasp

COPY --from=builder --chmod=755 --chown=owasp:owasp /home/owasp/.venv /home/owasp/.venv
COPY --from=builder --chmod=755 --chown=owasp:owasp /home/owasp /home/owasp
6 changes: 4 additions & 2 deletions backend/docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN addgroup -S owasp && \
adduser -S -h /home/owasp -G owasp owasp && \
mkdir -p /home/owasp && \
chown owasp:owasp /home/owasp && \
python -m pip install --no-cache-dir poetry
python -m pip install poetry

ENV FORCE_COLOR=1 \
POETRY_VIRTUALENVS_IN_PROJECT=true \
Expand All @@ -14,7 +14,8 @@ WORKDIR /home/owasp
USER owasp

COPY --chmod=444 poetry.lock pyproject.toml ./
RUN poetry install --no-root
RUN --mount=type=cache,target=/root/.cache/pypotery \
poetry install --no-root
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

COPY .env.example .env.example
COPY apps apps
Expand All @@ -38,4 +39,5 @@ ENV FORCE_COLOR=1 \
WORKDIR /home/owasp
USER owasp

COPY --from=builder --chmod=755 --chown=owasp:owasp /home/owasp/.venv /home/owasp/.venv
COPY --from=builder --chmod=555 --chown=owasp:owasp /home/owasp /home/owasp
6 changes: 4 additions & 2 deletions docs/docker/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN addgroup -S owasp && \
adduser -S -h /home/owasp -G owasp owasp && \
mkdir -p /home/owasp && \
chown owasp:owasp /home/owasp && \
python -m pip install --no-cache-dir poetry
python -m pip install poetry

ENV FORCE_COLOR=1 \
POETRY_VIRTUALENVS_IN_PROJECT=true \
Expand All @@ -16,7 +16,8 @@ WORKDIR /home/owasp
USER owasp

COPY --chmod=444 --chown=owasp:owasp docs/poetry.lock docs/pyproject.toml mkdocs.yaml ./
RUN poetry install --no-root && \
RUN --mount=type=cache,target=/root/.cache/pypotery \
poetry install --no-root && \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
rm -rf docs/poetry.lock docs/pyproject.toml

FROM python:3.13.3-alpine
Expand All @@ -36,4 +37,5 @@ EXPOSE 8001
USER owasp
WORKDIR /home/owasp

COPY --from=builder --chmod=755 --chown=owasp:owasp /home/owasp/.venv /home/owasp/.venv
COPY --from=builder --chmod=555 --chown=owasp:owasp /home/owasp /home/owasp
4 changes: 3 additions & 1 deletion frontend/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ WORKDIR /app

RUN npm install --ignore-scripts -g pnpm
COPY --chmod=444 package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
RUN --mount=type=cache,target=/root/.pnpm-store \
--mount=type=cache,target=/home/owasp/node_modules \
pnpm install --frozen-lockfile --ignore-scripts
Comment thread
ahmedxgouda marked this conversation as resolved.
Outdated

COPY --chmod=444 .env .pnpmrc next.config.ts postcss.config.js tailwind.config.js tsconfig.json ./
COPY --chmod=555 public public
Expand Down
2 changes: 2 additions & 0 deletions frontend/docker/Dockerfile.e2e.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ WORKDIR /app

COPY --chmod=444 package.json pnpm-lock.yaml ./
RUN npm install --ignore-scripts -g pnpm && \
--mount=type=cache,target=/root/.pnpm-store && \
--mount=type=cache,target=/app/node_modules && \
pnpm install --frozen-lockfile --ignore-scripts
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

COPY __tests__/e2e __tests__/e2e
Expand Down
6 changes: 3 additions & 3 deletions frontend/docker/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ RUN apk update && \
WORKDIR /home/owasp

COPY --chmod=444 --chown=node:node package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
RUN --mount=type=cache,target=/root/.pnpm-store \
--mount=type=cache,target=/home/owasp/node_modules \
pnpm install --frozen-lockfile --ignore-scripts

FROM node:22-alpine

Expand All @@ -21,8 +23,6 @@ RUN apk update && \
chown -R node:node /home/owasp && \
npm install --ignore-scripts -g pnpm

COPY --from=builder --chmod=755 --chown=node:node /home/owasp/node_modules /home/owasp/node_modules

EXPOSE 3000

USER node
Expand Down
2 changes: 2 additions & 0 deletions frontend/docker/Dockerfile.unit.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ WORKDIR /app

COPY --chmod=444 package.json pnpm-lock.yaml ./
RUN npm install --ignore-scripts -g pnpm && \
--mount=type=cache,target=/root/.pnpm-store && \
--mount=type=cache,target=/app/node_modules && \
pnpm install --frozen-lockfile --ignore-scripts && \
chown node:node /app
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

Expand Down
Loading