A fluffy engine for XDU 2017 fall SS SPM final exam.
Usage (Undone, TODO)
Get Quick Start
TODO (with simple-run.sh <- TODO)
First step is pull the images.
The images include:
You can pull them from Docker Hub or other mirror sites with commoands:
docker pull qinka/fluffy:fluffy-latest docker pull postgres:latest docker pull haskell:latest
fluffy:fluffy-latest is the back-end.
It need a PostgreSQL database(image
haskell is used to run the scripts to upload data from
Second step is run the images.
You can run it via docker-compose, or just run the command one-by-one.
The key idea is fluffy need to be linked with database.
The following is the example running with shell command one-by-one.
Create and run the PostgreSQL image:
docker run -d --name fluffy-db -e POSTGRES_PASSWORD=fluffypassword postgres
The detail can be found on Docker Hub - postgres.
Create and run the Fluffy image:
docker run -d -name fluffy-be --link fluffy-db:db -p 3000:3000 fluffy -c "fluffy 3000 host=db port=5432 user=postgres password=fluffypassword"
Then you can visit host-of-docker:3000, and the home page will be shown.
(optional for haskell image)
To update the data to database with script, you also need
a container with haskell's image.
So you can run:
docker run -d --name fluffy-haskell --link fluffy-db:db
Third step is import the data into database with script.
You need firstly initialize the sql table to PostgreSQL database.
docker exec -it fluffy-db /bin/bash
and then you will connect with container which host database.
After connected with that database, run the
psql to connect with the database
and initialize it with sql script:
Custom with Docker file
Custom via add file to container