Это мой файл docker-compose.yml, в котором postgresql должен быть развернут первым, чем служба migrations , и будут развернуты другие службы.
При использовании docker-compose он успешно развертывается и готов, но при попытке его развертывания с использованием стека докеров он застревает в некоторой части и перезапускается.У меня есть журналы внизу.Из этой части он перезапускается снова, не переходя в состояние готовности.
протоколы службы Docker службы postgresql
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-3-111.eu | The files belonging to this database system will be owned by user "postgres".
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-3-111.eu | The files belonging to this database system will be owned by user "postgres".
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-3-111.eu | The files belonging to this database system will be owned by user "postgres".
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-3-111.eu | The files belonging to this database system will be owned by user "postgres".
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-3-111.eu | This user must also own the server process.
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-3-111.eu | This user must also own the server process.
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-3-111.eu | This user must also own the server process.
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | This user must also own the server process.
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | The database cluster will be initialized with locale "en_US.utf8".
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | The database cluster will be initialized with locale "en_US.utf8".
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | The database cluster will be initialized with locale "en_US.utf8".
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | The database cluster will be initialized with locale "en_US.utf8".
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | The default database encoding has accordingly been set to "UTF8".
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | The default database encoding has accordingly been set to "UTF8".
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | The default database encoding has accordingly been set to "UTF8".
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | The default database encoding has accordingly been set to "UTF8".
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | The default text search configuration will be set to "english".
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | The default text search configuration will be set to "english".
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | The default text search configuration will be set to "english".
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | The default text search configuration will be set to "english".
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | Data page checksums are disabled.
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | Data page checksums are disabled.
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | Data page checksums are disabled.
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | Data page checksums are disabled.
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu |
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | fixing permissions on existing directory /var/lib/postgresql/data ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | fixing permissions on existing directory /var/lib/postgresql/data ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | fixing permissions on existing directory /var/lib/postgresql/data ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | fixing permissions on existing directory /var/lib/postgresql/data ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating subdirectories ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating subdirectories ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating subdirectories ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating subdirectories ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | selecting default max_connections ... 100
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | selecting default max_connections ... 100
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | selecting default max_connections ... 100
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | selecting default max_connections ... 100
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | selecting default shared_buffers ... 128MB
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | selecting default shared_buffers ... 128MB
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | selecting default shared_buffers ... 128MB
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | selecting default shared_buffers ... 128MB
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | selecting dynamic shared memory implementation ... posix
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | selecting dynamic shared memory implementation ... posix
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | selecting dynamic shared memory implementation ... posix
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | selecting dynamic shared memory implementation ... posix
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating configuration files ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating configuration files ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating configuration files ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating configuration files ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | initializing pg_authid ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | initializing pg_authid ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | initializing pg_authid ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | initializing pg_authid ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | initializing dependencies ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | initializing dependencies ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | initializing dependencies ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | initializing dependencies ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating system views ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating system views ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating system views ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating system views ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | loading system objects' descriptions ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | loading system objects' descriptions ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | loading system objects' descriptions ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | loading system objects' descriptions ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating collations ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating collations ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating collations ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating collations ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating conversions ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating conversions ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating conversions ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating conversions ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating dictionaries ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating dictionaries ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating dictionaries ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating dictionaries ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | setting privileges on built-in objects ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | setting privileges on built-in objects ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | setting privileges on built-in objects ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | setting privileges on built-in objects ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | creating information schema ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | creating information schema ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | creating information schema ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | creating information schema ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | loading PL/pgSQL server-side language ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | loading PL/pgSQL server-side language ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | loading PL/pgSQL server-side language ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | loading PL/pgSQL server-side language ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | vacuuming database template1 ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | vacuuming database template1 ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | vacuuming database template1 ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | vacuuming database template1 ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | copying template1 to template0 ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | copying template1 to template0 ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | copying template1 to template0 ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | copying template1 to template0 ... ok
stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | copying template1 to postgres ... ok
stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | copying template1 to postgres ... ok
stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | copying template1 to postgres ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | copying template1 to postgres ... ok
stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu | syncing data to disk ... stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu | syncing data to disk ... stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu | syncing data to disk ... stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu | syncing data to disk ...
Вот файл docker-compose, который я использовал, чтобы сделать его совместимым со стеком docker.Я добавил службу в ту же сеть и заставляю их работать под одним и тем же узлом менеджера.Ранее это было в версии 3.Я изменил его на версию 3.4 тоже
docker-compose.yml file
kong-database: image: "postgres: 9.5"restart: всегда сети: - среда api-net: POSTGRES_USER: kong POSTGRES_DB: kong healthcheck: test: [" CMD "," pg_isready "," -U "," postgres "] интервал: 5 с, тайм-аут: 5 с, повторные попытки: 5
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
kong-migration:
image: "kong:latest"
networks:
- api-net
command: "kong migrations up"
environment:
KONG_PG_HOST: kong-database
depends_on:
- kong-database
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
kong:
#build: ./dockerfiles/kong
image: "ncarlier:latest"
networks:
- api-net
environment:
KONG_PG_HOST: kong-database
KONG_PROXY_LISTEN: 0.0.0.0:8000
KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443
KONG_ADMIN_LISTEN: 0.0.0.0:8001
KONG_CUSTOM_PLUGINS: oidc
depends_on:
- kong-database
healthcheck:
test: ["CMD", "curl", "-f", "http://kong:8001"]
interval: 5s
timeout: 2s
retries: 15
ports:
- "8001:8001"
- "8000:8000"
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
konga:
image: "pantsel/konga:latest"
restart: always
networks:
- api-net
environment:
NODE_ENV: production
depends_on:
- kong
ports:
- "1337:1337"