[docker] fix healthcheck

This commit is contained in:
Aleksandr Soloshenko 2024-05-24 09:27:11 +07:00
parent 4c45ea1a81
commit 05661032b3
4 changed files with 12 additions and 8 deletions

View File

@ -44,4 +44,8 @@ LICENSE
.dockerignore
# Ignore the Go build directory
tmp/
tmp/
# Ignore build and deployments directories
deployments/
build/

View File

@ -4,7 +4,7 @@
@phone={{$dotenv PHONE}}
###
GET http://localhost:3000/health HTTP/1.1
GET {{baseUrl}}/health HTTP/1.1
###
GET {{baseUrl}}/api/3rdparty/v1/health HTTP/1.1

View File

@ -46,6 +46,6 @@ COPY --from=build /go/src/app /app
EXPOSE 3000
USER guest
HEALTHCHECK --interval=10s --timeout=3s --retries=3 --start-period=5s CMD [ "/app/app" "health" ]
HEALTHCHECK --interval=10s --timeout=3s --retries=3 --start-period=5s CMD /app/app health || exit 1
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@ -1,4 +1,3 @@
version: '3'
services:
backend:
image: capcom6/sms-gateway
@ -8,7 +7,7 @@ services:
args:
- APP=sms-gateway
environment:
- DEBUG=1
- DEBUG=
- CONFIG_PATH=config.yml
- GOOSE_DBSTRING=sms:sms@tcp(db:3306)/sms
- HTTP__LISTEN=0.0.0.0:3000
@ -21,21 +20,22 @@ services:
- "3000:3000"
volumes:
- ../../configs/config.yml:/app/config.yml:ro
restart: 'no'
restart: 'unless-stopped'
depends_on:
db:
condition: service_healthy
db:
image: mariadb:10.6
image: mariadb:10.11
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=sms
- MYSQL_USER=sms
- MYSQL_PASSWORD=sms
- MARIADB_AUTO_UPGRADE=1
volumes:
- mariadb-data:/var/lib/mysql
restart: 'no'
restart: 'unless-stopped'
healthcheck:
test:
[