grizzthedj
grizzthedj

Reputation: 7505

Which Official Docker Image(s) should I use for running an application with multiple dependencies?

I have a ruby on rails web application to deploy, using Docker containers that has the following dependencies.

I have tried starting with the official centos:latest image, then installing these dependencies on top of that, but since there are also official images for Ruby, RVM, MongoDB & nginx, I feel like I am missing out on using those, and duplicating efforts.

Is it possible to use multiple official docker images to accomplish this?

Upvotes: 0

Views: 68

Answers (2)

German
German

Reputation: 1705

To do what you need you have to use docker-compose. This technology allows you to define an environment with all the official images and you can make them interact. Performing the following steps.

docker-compose.yml

version: '3'
services:
  ruby:
    image: ruby:2.3
  mongodb:
    image: mongo
  nginx:
    image: nginx

See the documentation to use it: https://docs.docker.com/compose/

To run it´s simple like: docker-compose up

Upvotes: 1

Derick Bailey
Derick Bailey

Reputation: 72888

Is it possible to use multiple official docker images to accomplish this?

yes, and that's what you should do.

each process will be it's own image / container. look into docker-compose to coordinate multiple images into multiple containers.

Upvotes: 0

Related Questions