Is there a way to run the docker-compose app identically on k8s?
Currently the content of my docker-compose.yml file is as follows:
version: "3"
services:
registry:
restart: always
image: registry:2
ports:
- 5000:5000
environment:
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
REGISTRY_HTTP_TLS_KEY: /certs/domain.key
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
volumes:
- /home/app/docker/test/data:/var/lib/registry
- /home/app/docker/test/certs:/certs
- /home/app/docker/test/auth:/auth
nginx:
container_name: "nginx"
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- '80:80'
depends_on:
- node
node:
container_name: "node"
build:
context: ./web
dockerfile: Dockerfile
volumes:
- ./volumes/index.html:/usr/src/node/index.html
expose:
- "3000"
Can you change this to work with k8s?
2
Answers
Not sure if there’s an easy way to do that, but I heard about a tool called Kompose that might help you (I never tried it)
Try Kompose(github)