Initial curated EventLens source from 0d80d3b38dfb817285481665b9e71e4b8a0656a0
This commit is contained in:
commit
663ea8c829
85 files changed
+12395
No files matched your search
+45
@@ -0,0 +1,45 @@
|
||||
FROM node:22-alpine@sha256:c610fcdfb1d5b4740dd70c284ed3cb16bb857e0f7166196e36a5501df7a3aa32 AS frontend
|
||||
WORKDIR /src/frontend
|
||||
COPY VERSION /src/VERSION
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci --include=dev
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM python:3.12-alpine@sha256:b64631e04e4920160c50fbe8d8df828f7f35f06f425cb44aa09bca53e708a35a AS python-deps
|
||||
WORKDIR /build/backend
|
||||
COPY backend/pyproject.toml backend/uv.lock ./
|
||||
ENV UV_PROJECT_ENVIRONMENT=/opt/venv
|
||||
RUN python -m pip install --no-cache-dir uv==0.10.0 \
|
||||
&& uv sync --locked --no-dev --no-install-project
|
||||
|
||||
FROM python:3.12-alpine@sha256:b64631e04e4920160c50fbe8d8df828f7f35f06f425cb44aa09bca53e708a35a AS runtime
|
||||
ARG EVENTLENS_REVISION=local
|
||||
WORKDIR /app
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
ENV PATH="/opt/venv/bin:${PATH}"
|
||||
ENV EVENTLENS_REVISION=${EVENTLENS_REVISION}
|
||||
LABEL org.opencontainers.image.revision="${EVENTLENS_REVISION}"
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV EVENTLENS_FRONTEND_DIR=/app/frontend-dist
|
||||
ENV TMPDIR=/tmp
|
||||
|
||||
RUN apk add --no-cache 'libuuid=2.42.3-r1' \
|
||||
&& addgroup -S -g 10001 eventlens \
|
||||
&& adduser -S -D -H -u 10001 -G eventlens -s /sbin/nologin eventlens
|
||||
|
||||
COPY --from=python-deps --chown=eventlens:eventlens /opt/venv /opt/venv
|
||||
COPY --chown=eventlens:eventlens VERSION /app/VERSION
|
||||
COPY --chown=eventlens:eventlens backend/app/ /app/backend/app/
|
||||
COPY --chown=eventlens:eventlens samples/ /app/samples/
|
||||
COPY --from=frontend --chown=eventlens:eventlens /src/frontend/dist/ /app/frontend-dist/
|
||||
|
||||
USER eventlens
|
||||
EXPOSE 8000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()" || exit 1
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--app-dir", "/app/backend", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in new issue
Block a user