<file_sep>#!/bin/bash

# run the elm-live dev server with hot reloading
# point to dev-server/index.html
elm-live /app/dev-server/ButtonRender.elm \
    --output=elm.js \
    --port=4000 \
    --host=0.0.0.0 \
    --open --pushstate
<file_sep>#!/bin/bash
# runs shell in app container

NODE_ENV=${1:-local}
echo "Running with NODE_ENV=$NODE_ENV"

# stop and remove the containers if they are running
stop_and_remove_container()
{
    docker stop elm-buttons
    docker rm elm-buttons
}
stop_and_remove_container || true

# run the elm-buttons container
docker run \
    --rm \
    -v $(pwd)/src:/app/src/ \
    -v $(pwd)/dev-server:/app/dev-server/ \
    -e NODE_ENV=$NODE_ENV \
    --publish 4000:4000 \
    --publish 35729:35729 \
    --entrypoint=/bin/bash \
    -ti elm-buttons
<file_sep>#!/bin/bash
docker build -t elm-buttons .
<file_sep>FROM node:7.2.0

MAINTAINER <NAME> <<EMAIL>>

RUN npm install -g elm@0.18.0 \
    && npm install -g elm-test@0.18.0 \
    && npm install -g elm-live@2.7.5

# Add project code
ADD . /app
WORKDIR /app
ADD elm-package.json /app/elm-package.json

RUN elm-package install --yes

EXPOSE 4000 4000
#live-reload
EXPOSE 35729 35729
<file_sep># elm-buttons
my goal is to produce well-designed, reusable button components written for elm applications

## setup
requirements:

  * docker must be installed
  * linux terminal must be available

run the dev-server with hot-reloading:

1. build the docker container (in a linux shell)
  * `cd elm-buttons`
  * `./docker/build-container.sh`
2. run the development server (in a linux shell)
  * `./docker/dev-server.sh`
3. open up `localhost:4000` in a web browser

Once the dev-server is running, you can play around with source files in `elm-buttons/src`.  Changes will automatically trigger a re-compile and browser refresh.
<file_sep>#!/bin/bash
# runs webpack in app container

NODE_ENV=${1:-development}
echo "Running with NODE_ENV=$NODE_ENV"

# stop and remove the containers if they are running
stop_and_remove_container()
{
    docker stop elm-buttons
    docker rm elm-buttons
}
stop_and_remove_container || true

# run the workbench container
docker run \
    -v $(pwd)/src:/app/src/ \
    -v $(pwd)/dev-server:/app/dev-server/ \
    -e NODE_ENV=$NODE_ENV \
    --name=elm-buttons \
    --publish 4000:4000 \
    --publish 35729:35729 \
    --entrypoint=/app/entrypoints/dev-server.sh \
    -t elm-buttons
