简体   繁体   中英

How can I use Codenvy to run multiple published Docker Images?

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.

  1. 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" }, 
  2. 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" } }, 
  3. Create a workspace that uses this multi-machine image

  4. After starting the workspace, look at the workspace configuration to determine the public URL for the service.

在此处输入图片说明

  1. Codenvy sets up a common SSH key on each container in the workspace. Using this key, I am able to transfer files between containers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM