-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
koyeb compose #218
base: master
Are you sure you want to change the base?
koyeb compose #218
Conversation
18f1bdf
to
03394fe
Compare
Few notes:
On a docker-compose file, you have to define a volume and reference them in the services:
backend:
image: example/database
volumes:
- db-data:/etc/data
backup:
image: backup-service
volumes:
- db-data:/var/lib/backup/data
volumes:
db-data: I see several alternatives to the one in the PR for the compose file. For example: apps:
myapp:
myapp2:
services:
- app: myapp
name: myservice
ports: ["80:80"]
- app: myapp2
name: myservice2
ports: ["80:80"] And to reference archives: apps:
myapp:
myapp2:
archives:
my-flask-app:
build: .
services:
- app: myapp
name: myservice
ports: ["80:80"]
archive: my-flask-app
- app: myapp2
name: myservice2
ports: ["80:80"] (note that several services could use the same archive) Alternatively, since apps don't have any other parameter except their names, we could have the following syntax: services:
- name: myapp/myservice
ports: ["80:80"]
- name: myapp2/myservice2
ports: ["80:80"] Or, even better: services:
myapp/myservice:
ports: ["80:80"]
myapp2/myservice2:
ports: ["80:80"] And in the future, if we want to add parameters to the app, we can simply add the section which is optional by default: apps:
myapp:
futureparam: xxx
services:
myapp/myservice:
ports: ["80:80"]
myapp2/myservice2:
ports: ["80:80"] here Also, there's something I don't understand. In the example of the command, you show what the compose file looks like: # Init koyeb-compose.yaml file
$> echo 'apps:
- name: example-app
services:
- name: example-service1
image: nginx:latest
ports:
- 80:80
- name: example-service2
path: github.com/koyeb/golang-example-app
branch: main
ports:
- 8080:8080
depends_on:
- example-service1' > koyeb-compose.yaml
# Apply compose file
$> koyeb compose koyeb-compose.yaml But: type KoyebComposeService struct {
koyeb.DeploymentDefinition `yaml:",inline"`
DependsOn []string `json:"depends_on"`
} the type contains a |
docker-compose alike functionality for koyeb