This commit is contained in:
parent
3f80530786
commit
c3332572c0
4 changed files with 18 additions and 1 deletions
|
|
@ -32,6 +32,8 @@ steps:
|
||||||
- "sha-${CI_COMMIT_SHA:0:8}"
|
- "sha-${CI_COMMIT_SHA:0:8}"
|
||||||
cache_from: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
cache_from: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
||||||
cache_to: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
cache_to: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
||||||
|
build_args:
|
||||||
|
- "GIT_COMMIT=${CI_COMMIT_SHA:0:8}"
|
||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
branch: main
|
branch: main
|
||||||
|
|
@ -54,6 +56,8 @@ steps:
|
||||||
- "sha-${CI_COMMIT_SHA:0:8}" # всегда — нужно для отката
|
- "sha-${CI_COMMIT_SHA:0:8}" # всегда — нужно для отката
|
||||||
cache_from: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
cache_from: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
||||||
cache_to: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
cache_to: "git.ihateamerica.ru/dv/intrabot:buildcache"
|
||||||
|
build_args:
|
||||||
|
- "GIT_COMMIT=${CI_COMMIT_SHA:0:8}"
|
||||||
when:
|
when:
|
||||||
- event: tag
|
- event: tag
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,11 @@ RUN mkdir -p /app/data
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
ARG GIT_COMMIT=dev
|
||||||
|
ARG DOCKER_IMAGE_CREATED=unknown
|
||||||
|
ENV GIT_COMMIT=$GIT_COMMIT
|
||||||
|
ENV BUILD_TIME=$DOCKER_IMAGE_CREATED
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Продакшен: Gunicorn (gthread, 1 worker) обслуживает Flask.
|
# Продакшен: Gunicorn (gthread, 1 worker) обслуживает Flask.
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
services:
|
services:
|
||||||
intradbot:
|
intradbot:
|
||||||
image: git.example.com/YOUR_USER/intradbot:latest # ← замени на свой хост/юзер
|
image: git.ihateamerica.ru/dv/intrabot:latest # ← замени на свой хост/юзер
|
||||||
restart: always
|
restart: always
|
||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,14 @@ def health():
|
||||||
return jsonify({"status": "ok"}), 200
|
return jsonify({"status": "ok"}), 200
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/version")
|
||||||
|
def version():
|
||||||
|
return jsonify({
|
||||||
|
"commit": os.environ.get("GIT_COMMIT", "dev"),
|
||||||
|
"built_at": os.environ.get("BUILD_TIME", "unknown"),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
# ── Дашборд ────────────────────────────────────────────────────────────────────
|
# ── Дашборд ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue