8 Docker and Docker Compose
8.1 Docker
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
- deb: libmagick++-dev (Debian, Ubuntu)
- rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
- csw: imagemagick_dev (Solaris)
- brew imagemagick@6 (MacOS)
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
8.2 Docker Compose: Managing Containers
Docker Compose manages Docker containers, each acting as an isolated environment for parts of your application. Think of containers as mini-computers within your main server, each running its own subset of your application. This modular approach allows for efficient management of different application components. Docker Compose facilitates the orchestration of these containers, handling their creation, configuration, and interaction.
8.3 Streamlining Development and Deployment
By combining NGINX, make, and Docker Compose, you create a robust development environment. NGINX secures the entry points to your server, while Docker Compose ensures each component of your application is neatly organized in containers. ‘make’ further simplifies the build process. This setup allows you to develop, update, scale, and modify your application components without disrupting the overall system.
For developers, this integration means less time spent on configurations and more time for creativity and productivity. You’re not just building an application; you’re creating an interconnected ecosystem where each part contributes seamlessly to the whole. While assembling all these components into a working order can be challenging, tools like ndexr simplify the process, offering streamlined setup and the flexibility to restart and reconfigure components as needed.
version: '3.9'
services:
ndexrio:
image: registry.gitlab.com/fdrennan/rapp:ndexrio
restart: unless-stopped
build:
context: ./services/console
ports:
- 9000-9009:8000
network_mode: bridge
command: ["R", "-e", "options(ndexr_site='ndexrio');shiny::runApp('/app/src')"]
profiles:
- ndexrio
postgres:
container_name: ndexr_postgres
restart: unless-stopped
env_file: .env
build:
context: ./services/postgres
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- '5432:5432'
expose:
- '5432'
network_mode: bridge
profiles:
- db
redis:
container_name: ndexr_redis
restart: unless-stopped
image: redis:6.2-alpine
command: redis-server
volumes:
- redis-data:/data
ports:
- '6379:6379'
expose:
- '6379'
network_mode: bridge
profiles:
- db
volumes:
redis-data:
postgres-data: