env
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Deploy Telegram Bot / Deploy Telegram Bot (push) Waiting to run

This commit is contained in:
Dmitry 2025-12-11 20:59:30 +03:00
parent d377a871fc
commit 391c54fb15
3 changed files with 12 additions and 2 deletions

View file

@ -56,9 +56,9 @@ ENV PORT=3000 \
EXPOSE 3000
# Healthcheck - проверка доступности API
# Healthcheck - проверка доступности сервера
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=5 \
CMD sh -c 'curl -sf http://127.0.0.1:${PORT:-3000}/api/v2/packs || exit 1'
CMD sh -c 'curl -sf http://127.0.0.1:${PORT:-3000}/health || exit 1'
# Start server - все настройки читаются из environment variables
CMD ["/app/server"]

View file

@ -147,6 +147,15 @@ class MnemoShelf {
.addHandler(v2Router);
final rootRouter = Router()
..get('/health', (Request request) async {
return Response.ok(
'OK',
headers: {
'Content-Type': 'text/plain',
...corsConfig,
},
);
})
..mount('/api/v2', v2Handler)
..all('/<ignored|.*>', (Request request) async {
if (request.method == 'OPTIONS') {

View file

@ -35,6 +35,7 @@ RUN apt-get update \
ca-certificates \
curl \
zip \
procps \
&& rm -rf /var/lib/apt/lists/*
# Copy bot binary