I have Minio in docker container called "be_minio". I want connect to that container with my app from another container called "be_api".
be_api:
build: .
restart: always
ports:
- 8080:80
depends_on:
- be_minio
be_minio:
image: minio/minio
restart: always
ports:
- 9000:9000
- 9001:9001
volumes:
- ./volume_minio:/data
command: server --address ":9000" --console-address ":9001" /data
environment:
...
Config file with node sdk
const Minio = require('minio')
const minioClient = new Minio.Client({
endPoint: "be_minio",
port: 9000,
useSSL: false,
accessKey: ...,
secretKey: ...
})
export default minioClient
But endPoint "be_minio" is not valid url.
S3Error: Invalid Request (invalid hostname)
Is there some solution for that ? E.g some networking, or something like that ?
2
Answers
After long time of searching, trying, coding, etc, I found some mistakes, but what exactly caused the problem isn't clear.
Boolean(process.env.ssl) ## Boolean("false") -> true
Although I managed to get this working, when I generate public url, minioClient return docker-compose service name as domain :(.
You should be using X-Forwarded HTTP headers. Check this doc with Nginx as example: https://min.io/docs/minio/linux/integrations/setup-nginx-proxy-with-minio.html