https://github.com/carstenkoenig/dockerdemo
Demonstrates using Docker-Compose with Nginx, PostgreSQL and a simple Todo Web-App written in Haskell and Elm
https://github.com/carstenkoenig/dockerdemo
docker docker-compose elm haskell nginx todoapp
Last synced: 3 months ago
JSON representation
Demonstrates using Docker-Compose with Nginx, PostgreSQL and a simple Todo Web-App written in Haskell and Elm
- Host: GitHub
- URL: https://github.com/carstenkoenig/dockerdemo
- Owner: CarstenKoenig
- Created: 2018-07-27T09:14:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-30T05:00:29.000Z (almost 8 years ago)
- Last Synced: 2025-01-28T04:46:53.365Z (over 1 year ago)
- Topics: docker, docker-compose, elm, haskell, nginx, todoapp
- Language: Elm
- Size: 1.09 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo-App
this is a simple *TODO-App* demonstrating:
- Haskell / Servant
- Elm
- Docker (-compose) with
- Nginx
- PostgreSQL
- compiled servant app
## Backends
- [Haskell](./server/Haskell)
## Client
- [Elm](./client/Elm)
## Build
### using docker
- run `make docker-build` to build the service
- run `make docker-run` to run the service attached
- run `make docker-install` to run the service detached (background)
- run `make docker-clean` to remove the service and the docker-volume
once the application runs you should be able to browse to `http:\\localhost:8070`
and use the *todo-app*
### local using stack
run `make deploy` to deploy the application to `./dist`
the application assumes a PostgreSQL-DB present and you have to provide
the following settings via environment-variables (postgres default behavior with connection-strings):
- `PGUSER` the user that will connect to postgres
- `PGPASSWORD` the password for the connecting user
- `PGHOST` hostname of the database (probably `localhost`)
- `DB_CONSTR` (optional/alternative) - connection-string used by the app - default is `"dbname='Todos'"` so this assumes that there is a `Todos` database present on postgres
there is a way to use this app with just `SQLite` - look for lines like
import qualified DbPg as Db
in `src/RestApi.hs` and `src/App.hs` and change it to
import qualified Db
you will also have to change the line
dbHandle <- Db.initDb dbCon 4
in `App.hs` into
dbHandle <- Db.initDb "./todos.db"