Update deployment documentation.

[?]
Nov 2, 2016, 3:10 AM
LEINLS3X55PB6TSCNC5RVMDMV56XHTV4MNDUC42H7DDFMPDYUNTAC

Dependencies

  • [2] WVVD2KC4 ignore moo.cfg file
  • [3] 7VGYLTMU Clean up schema version handling.
  • [4] DXIGERDT Change order of Docker build to avoid rebuilding the universe.
  • [*] ADMKQQGC Initial empty Snap project.
  • [*] AXKKXBWN Initial attempt at writing down my ideas for a company based on trust.
  • [*] 4ZLEDBK7 Initial attempts at dockerizing, cabal isn't cooperating.
  • [*] E2KOBKIJ Add setup script detailing the setup of the docker host.
  • [*] XZLSHL4D The server is now (tenuously) running, and serving pages via SSL!
  • [*] 2WOOGXDH Use dbmigrations to manage database state.

Change contents

  • edit in .gitignore at line 23
    [2.9]
    site_key.txt
  • file addition: DEPLOY.md (----------)
    [7.2]
    Deployment
    ==========
    At present, the aftok software is deployed on a DigitalOcean virtual machine.
    The deployment architecture is relatively unsophisticated; both the
    docker engine and a postgres server are running directly on the host VM,
    and all other services are provided by containers.
    Configuration files for container-based services are stored on the
    host vm under `/opt/containers/<container-name>` and are mounted
    into the appropriate containers as part of the `docker run` invocations
    that are used to run the containers. A high-priority objective is to
    simplify this setup by using `docker compose` to orchestrate the
    containers, and to containerize the postgres server and data.
    Docker Hub
    ----------
    Configuration-free images containing the aftok server application is hosted on
    dockerhub at nuttycom/aftok. To push a new version:
    ~~~{bash}
    docker build -t nuttycom/aftok:$(git describe)
    ~~~
    Manual Setup
    ------------
    See `deploy/setup.sh` for a complete list of the operations that were
    performed manually on the vm to get the aftok.com server up and running.
  • edit in Dockerfile at line 35
    [4.368]
    [8.1024]
    RUN apt-get install -y libsqlite3-dev
    RUN stack install dbmigrations
  • edit in Dockerfile at line 42
    [3.222]
    [3.222]
    ADD ./migrations /opt/aftok/migrations
  • file addition: Makefile (----------)
    [7.2]
    build-container:
    docker build -t aftok/aftok:latest .
    run-local-docker:
    docker run --net=host -it -v /home/nuttycom/projects/aftok/docker-conf/:/etc/aftok aftok/aftok:latest
  • edit in deploy/setup.sh at line 24
    [10.1485]
    [9.648]
    # get the aftok image from dockerhub
    docker login
    docker pull nuttycom/aftok:0.1
  • file addition: 2016-10-29_20-54-44_auction-timestamps.txt (----------)
    [11.1]
    Description: (Describe migration here.)
    Created: 2016-10-29 20:54:59.060159 UTC
    Depends: 2016-10-13_05-36-55_user-event-log
    Apply: |
    ALTER TABLE auctions ADD COLUMN created_at timestamp with time zone not null;
    ALTER TABLE auctions ADD COLUMN start_time timestamp with time zone not null;
    Revert: |
    ALTER TABLE auctions DROP COLUMN start_time;
    ALTER TABLE auctions DROP COLUMN created_at;