Public Repository

Last pushed: a year ago
Short Description
Run webspecs/publican within a container
Full Description

Work in progress.

Run webspecs/publican in a container. This is based on webplatform/publican task-based-docker fork

Try it out

From a computer that has Docker installed, launch container;

docker pull webspecs/publican
docker run -it --rm -p 7002:7002 webspecs/publican bin/run.sh
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: /srv/webplatform/specs/bin/server.js
data:    /srv/webplatform/specs/bin/server.js:16 - info: Publican/0.3.1 up and running.
...

If you are running on Mac OS, get the IP address of boot2docker runner

boot2docker ip
192.168.59.103

From another console tab, test the service using curl:

curl 192.168.59.103:7002
{"publican":"0.3.1"}⏎

Run using Docker Compose

Like it would be done in production.

First, ensure you have Docker Compose installed.

Then, create a folder that’ll contain a data/ folder, the one publican would expect.

In this folder, create a file called docker-compose.yml with the following YAML contents.


# file: docker-compose.yml
# ref:
#   - http://docs.docker.com/compose/
#   - http://docs.docker.com/compose/yml/

web:
  image: webspecs/publican

  # Default run is bash, using this we enforce our service to
  # run publican server for us while allowing us to enter the container
  # in case of need to understand what’s available inside.
  command: bin/run.sh

  # Make sure you have a data folder in the same
  # directory as this file. Container expects the following
  # in data/{logs,queue} AND also data/config.json
  volumes:
    - data/:/srv/webplatform/specs/data

  restart: always

  # Production internal server uses port 8002, so we prevent port
  # number collision internally if two web apps we deploy happen
  # to use same port.
  ports:
    - "8002:7002" 

  # In production, we also add here our internal DNS server here
  dns:
    - 8.8.8.8

Run

docker-compose up -d

Follow the logs

docker-compose logs
Docker Pull Command
Owner
webspecs

Comments (0)