Hi,
I’m trying to add Tyk to a docker-compose
project. I copied the configuration over from the docker-compose.yml
file provided in the tyk-gateway-docker
repo. However, when I change the locations of the folders to mount as volumes, even though it creates the folders, I get the following error:
ERROR: for directlink-switchboard_tyk-gateway_1 Cannot start service tyk-gateway:
OCI runtime create failed: container_linux.go:380: starting container process caused:
process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/host_mnt/Users/daniel/code/directlink-switchboard/domains/gateway/tyk.standalone.conf" to rootfs at "/opt/tyk-gateway/tyk.conf" caused: mount through procfd: not a directory: unknown:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
The folders are created when I run docker-compose up
:
Here is my docker-compose.yml
:
version: '3.4'
services:
eventstore:
image: eventstore/eventstore:latest
environment:
- EVENTSTORE_CLUSTER_SIZE=${EVENTSTORE_CLUSTER_SIZE}
- EVENTSTORE_RUN_PROJECTIONS=${EVENTSTORE_RUN_PROJECTIONS}
- EVENTSTORE_START_STANDARD_PROJECTIONS=${EVENTSTORE_START_STANDARD_PROJECTIONS}
- EVENTSTORE_EXT_TCP_PORT=${EVENTSTORE_EXT_TCP_PORT}
- EVENTSTORE_HTTP_PORT=${EVENTSTORE_HTTP_PORT}
- EVENTSTORE_INSECURE=${EVENTSTORE_INSECURE}
- EVENTSTORE_ENABLE_EXTERNAL_TCP=${EVENTSTORE_ENABLE_EXTERNAL_TCP}
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=${EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP}
networks:
- eventstore_net
ports:
- '${EVENTSTORE_EXT_TCP_PORT}:${EVENTSTORE_EXT_TCP_PORT}'
- '${EVENTSTORE_HTTP_PORT}:${EVENTSTORE_HTTP_PORT}'
volumes:
- type: volume
source: eventstore-volume-data
target: /var/lib/eventstore
- type: volume
source: eventstore-volume-logs
target: /var/log/eventstore
redis:
image: redis:latest
networks:
- tyk_net
tyk-gateway:
image: docker.tyk.io/tyk-gateway/tyk-gateway:latest
ports:
- '${TYK_GW_PORT}:8080'
networks:
- tyk_net
volumes:
- ./domains/gateway/tyk.standalone.conf:/opt/tyk-gateway/tyk.conf
- ./domains/gateway/apps:/opt/tyk-gateway/apps
- ./domains/gateway/middleware:/opt/tyk-gateway/middleware
- ./domains/gateway/certs:/opt/tyk-gateway/certs
environment:
- TYK_GW_SECRET=${TYK_GW_SECRET}
depends_on:
- redis
volumes:
eventstore-volume-data:
eventstore-volume-logs:
networks:
eventstore_net:
tyk_net:
Any help would be appreciated. Thanks!