Skip to content

Docker: Build and Install

Eduard Marbach edited this page Oct 6, 2018 · 6 revisions

Docker

Build the image

Following steps are required to build the docker image:

  1. Build the necessary zip-file for docker. Will be done via grunt tasks. (Commands grunt build:docker)
  2. Build the docker image with the provided Dockerfile. (Commands docker build -t restyaplatform/restyaboard .)

The steps are concatenated via a npm script (check package.json). The grunt-cli have to be installed in first place. Then you can run npm run docker:fullbuild

Publish image

To publish the image you have to use the CLI of docker. Check HERE

Install/Start

Docker-Compose (Cleaner)

The restyaboard platform will be available through docker hub and the specified name.

To easily startup the application you can use following compose:

version: '2'
volumes:
  restyaboard_db:
    driver: local
  restyaboard_media:
    driver: local
services:
  restyaboard:
    image: restyaplatform/restyaboard:dev
    environment:
      POSTGRES_DB: restyaboard
      POSTGRES_HOST: postgres
      POSTGRES_PASSWORD: admin
      POSTGRES_USER: admin
      SMTP_DOMAIN: domain
      SMTP_USERNAME: user
      SMTP_PASSWORD: pass
      SMTP_SERVER: server
      SMTP_PORT: 465
      TZ: Etc/UTC
    volumes:
    - restyaboard_media:/usr/share/nginx/html/media
    ports:
    - "8081:80"
  postgres:
    image: postgres:9-alpine
    environment:
      POSTGRES_DB: restyaboard
      POSTGRES_HOST: postgres
      POSTGRES_PASSWORD: admin
      POSTGRES_USER: admin
    volumes:
    - restyaboard_db:/var/lib/postgresql/data

Then just run docker-compose up -d and everything will startup (docker-compose down for removing everyhing).

Via docker run

If you run via run command you have to start the postgres db in advance make it accessible. (docker-compose easier because it starts network adapters for the stack).

docker run --rm -d -e POSTGRES_DB='restyaboard' \
-e POSTGRES_HOST='postgres' \
-e POSTGRES_PASSWORD='admin' \
-e POSTGRES_USER='admin' \
-p 8081:80 \
--name restyaboard restyaplatform/restyaboard:dev
Clone this wiki locally