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
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:
parent
d377a871fc
commit
391c54fb15
3 changed files with 12 additions and 2 deletions
|
|
@ -56,9 +56,9 @@ ENV PORT=3000 \
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Healthcheck - проверка доступности API
|
# Healthcheck - проверка доступности сервера
|
||||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=5 \
|
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
|
# Start server - все настройки читаются из environment variables
|
||||||
CMD ["/app/server"]
|
CMD ["/app/server"]
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,15 @@ class MnemoShelf {
|
||||||
.addHandler(v2Router);
|
.addHandler(v2Router);
|
||||||
|
|
||||||
final rootRouter = Router()
|
final rootRouter = Router()
|
||||||
|
..get('/health', (Request request) async {
|
||||||
|
return Response.ok(
|
||||||
|
'OK',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'text/plain',
|
||||||
|
...corsConfig,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
..mount('/api/v2', v2Handler)
|
..mount('/api/v2', v2Handler)
|
||||||
..all('/<ignored|.*>', (Request request) async {
|
..all('/<ignored|.*>', (Request request) async {
|
||||||
if (request.method == 'OPTIONS') {
|
if (request.method == 'OPTIONS') {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ RUN apt-get update \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
zip \
|
zip \
|
||||||
|
procps \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy bot binary
|
# Copy bot binary
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue