Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.08 KB

Docker.md

File metadata and controls

47 lines (32 loc) · 1.08 KB

Docker

Docker is a software container platform that integrates easily into Chalet.

Dockerfile

A Dockerfile is used to create a single container. Here is an example:

FROM httpd:2.4
COPY ./public-html/ /usr/local/apache2/htdocs/

To build this image, run the following in the application directory:

docker build -t my-apache2 .

To use Chalet for this example, run the following in the application directory:

chalet add 'docker run -dit --name my-running-app my-apache2'

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. Here is a simple example:

version: '3'
services:
  web:
    build: .
    ports:
     - "5000:5000"

This binds the internal port 5000 on the container to port 5000 on the host machine. To build this image, run the following:

docker-compose build

To use Chalet for this, run the following in the application directory:

chalet add 'docker-compose up' -p 5000