I would like to use Codenvy as a development and test environment for a project with published Docker images.
Here is a simplified version of the docker-compose configuration that I would like to replicate on Codenvy.
services:
dspacedb:
image: dspace/dspace-postgres-pgcrypto
volumes:
- pgdata:/pgdata
dspace:
image: "dspace/dspace:dspace-6_x"
ports:
- 8080:8080
volumes:
- "assetstore:/dspace/assetstore"
- "solr:/dspace/solr"
depends_on:
- dspacedb
Based on my testing, I am unable to define volumes for my images. Fortunately, the Codenvy workspace persists the state of my containers between executions.
Here is the solution that I have currently implemented. I am curious to learn if there is a better approach.
Create a multi-machine stack that contains the desired images plus add an additional machine (eclipse/ubuntu_jdk8) to run the IDE.
"recipe": {
"type": "compose",
"content": "services:\n dev-machine:\n image: eclipse/ubuntu_jdk8\n dspacedb:\n image: dspace/dspace-postgres-pgcrypto\n mem_limit: 536870912\n dspace:\n image: 'dspace/dspace:dspace-6_x'\n mem_limit: 2147483648\n",
"contentType": "application/x-yaml"
},
Explicitly create a "server" for the container that I wish to expose with a public URL.
"dspace": {
"attributes": {
"memoryLimitBytes": "2684354560"
},
"servers": {
"dspace": {
"properties": {},
"protocol": "http",
"port": "8080"
}
},
Create a workspace that uses this multi-machine image