Refactor Docker setup and add mock data support

- Updated .dockerignore and .gitignore for better file management.
- Introduced .env.example for environment variable configuration.
- Added docker-compose.dev.yml for development with mock data and live reload.
- Enhanced Dockerfile to include necessary dependencies and entrypoint script.
- Created mock_data.py to provide sample data for testing without OpenStack/Prometheus.
- Added unit tests for template filters in dashboard.
- Cleaned up various files for consistency and improved readability.
This commit is contained in:
2026-02-06 16:12:21 +03:00
parent d197d1e5e2
commit 57a2933f28
33 changed files with 3319 additions and 3050 deletions

View File

@@ -1,32 +1,37 @@
FROM alpine:3 AS build
RUN apk update && \
apk add --no-cache --virtual .build-deps \
ca-certificates gcc postgresql-dev linux-headers musl-dev \
libffi-dev jpeg-dev zlib-dev \
git bash build-base python3-dev
RUN python3 -m venv /venv
ENV PATH "/venv/bin:$PATH"
COPY ./requirements.txt /
RUN pip install -r /requirements.txt
FROM alpine:3
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONUNBUFFERED 1
ENV PATH "/venv/bin:$PATH"
RUN apk add --no-cache --update python3
COPY --from=build /venv /venv
RUN mkdir /app
WORKDIR /app
COPY ./ /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ]
FROM alpine:3 AS build
RUN apk update && \
apk add --no-cache --virtual .build-deps \
ca-certificates gcc postgresql-dev linux-headers musl-dev \
libffi-dev jpeg-dev zlib-dev \
git bash build-base python3-dev \
dos2unix
RUN python3 -m venv /venv
ENV PATH "/venv/bin:$PATH"
COPY ./requirements.txt /
RUN pip install -r /requirements.txt
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN dos2unix /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
FROM alpine:3
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONUNBUFFERED 1
ENV PATH "/venv/bin:$PATH"
RUN apk add --no-cache --update python3 curl
COPY --from=build /venv /venv
COPY --from=build /docker-entrypoint.sh /docker-entrypoint.sh
WORKDIR /app
COPY . /app
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]