use docker service healthy condition instead of external docker-compose-wait dependency
This commit is contained in:
@ -1,7 +1,5 @@
|
|||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
|
|
||||||
COPY --from=ghcr.io/ufoscout/docker-compose-wait:latest /wait /wait
|
|
||||||
|
|
||||||
ADD ./ /app
|
ADD ./ /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
@ -4,21 +4,22 @@ services:
|
|||||||
meshtastic-mqtt:
|
meshtastic-mqtt:
|
||||||
container_name: meshtastic-mqtt
|
container_name: meshtastic-mqtt
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
database:
|
||||||
|
condition: service_healthy
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
command: /app/docker/mqtt.sh
|
command: /app/docker/mqtt.sh
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "mysql://root:password@database:3306/meshtastic-map?connection_limit=100"
|
DATABASE_URL: "mysql://root:password@database:3306/meshtastic-map?connection_limit=100"
|
||||||
WAIT_HOSTS: "database:3306"
|
|
||||||
MQTT_OPTS: "" # add any custom mqtt.js options here
|
MQTT_OPTS: "" # add any custom mqtt.js options here
|
||||||
|
|
||||||
# runs the web map ui
|
# runs the web map ui
|
||||||
meshtastic-map:
|
meshtastic-map:
|
||||||
container_name: meshtastic-map
|
container_name: meshtastic-map
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
database:
|
||||||
|
condition: service_healthy
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
@ -27,7 +28,6 @@ services:
|
|||||||
- 8080:8080/tcp
|
- 8080:8080/tcp
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "mysql://root:password@database:3306/meshtastic-map?connection_limit=100"
|
DATABASE_URL: "mysql://root:password@database:3306/meshtastic-map?connection_limit=100"
|
||||||
WAIT_HOSTS: "database:3306"
|
|
||||||
MAP_OPTS: "" # add any custom index.js options here
|
MAP_OPTS: "" # add any custom index.js options here
|
||||||
|
|
||||||
# runs the database to store everything from mqtt
|
# runs the database to store everything from mqtt
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Waiting for mysql"
|
|
||||||
/wait || exit 111
|
|
||||||
|
|
||||||
echo "Running migrations"
|
echo "Running migrations"
|
||||||
npx prisma migrate dev
|
npx prisma migrate dev
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Waiting for mysql"
|
|
||||||
/wait || exit 111
|
|
||||||
|
|
||||||
echo "Running migrations"
|
echo "Running migrations"
|
||||||
npx prisma migrate dev
|
npx prisma migrate dev
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user