mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-14 15:34:19 +00:00
* chore(CI): import pre-commit-config.yaml from prowler-cloud/prowler * chore(CI): import pre-commit-config.yaml from prowler-cloud/prowler * chore(CI): add safety package to pre-commit * chore(CI): use poetry run to access venv for local checks * docs(repo): add community focused docs * chore(GitHub): add ISSUE_TEMPLATEs same as prowler-cloud/prowler repo * chore(CI): add pull-request.yml workflow runs on PRs and pushes to main * chore(CI): add additional workflows same as those on prowler-cloud/prowler * fix(CI): use correct path * fix(API): fix flake8 F401 failures * fix(API, Backend): format with black * fix( Backend): format with black * fix(CI): use correct path * fix(CI): move pyproject.toml * fix(CI): simplify tools with ruff * fix(CI): use ruff instead of flake8, black * fix(CI): change ruff commands for GHA * fix(CI): use correct ruff command name * fix(Backend): ruff format * fix(CI): ignore safety jinja2 vuln id 70612 and add mypy for future usage * fix(CI): set file path for hadolint * fix(CI): add dockle * fix(CI): update dockle version * fix(CI): fix hadolint errors * fix(CI): add simple tests for CI * fix(Docker): multi-stage docker build * docs(README): update docs for poetry location
43 lines
861 B
Docker
43 lines
861 B
Docker
FROM python:3.12-alpine as build
|
|
|
|
LABEL maintainer="https://github.com/prowler-cloud/restful-api"
|
|
|
|
RUN apk --no-cache upgrade && \
|
|
addgroup -g 1000 prowler && \
|
|
adduser -D -u 1000 -G prowler prowler
|
|
USER prowler
|
|
|
|
WORKDIR /home/prowler
|
|
|
|
COPY pyproject.toml ./
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir poetry
|
|
|
|
COPY src/backend/ ./backend/
|
|
|
|
ENV PATH="/home/prowler/.local/bin:$PATH"
|
|
|
|
RUN poetry install && \
|
|
rm -rf ~/.cache/pip
|
|
|
|
WORKDIR /home/prowler/backend
|
|
|
|
# Development image
|
|
# hadolint ignore=DL3006
|
|
FROM build as dev
|
|
|
|
USER 0
|
|
RUN apk --no-cache add curl=8.8.0-r0 vim=9.1.0414-r0
|
|
|
|
USER prowler
|
|
|
|
ENTRYPOINT ["poetry", "run", "python", "manage.py", "runserver", "0.0.0.0:8000"]
|
|
|
|
|
|
# Production image
|
|
FROM build
|
|
|
|
# TODO use ASGI
|
|
ENTRYPOINT ["poetry", "run", "python", "manage.py", "runserver", "0.0.0.0:8000"]
|