commercialhaskell / commercialhaskell/stack-templates
ServantDocker doesn't work out of the box
- Dominant language
- Haskell
- Stars
- 245
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
tldr;
1. The Dockerfile needs to inherit from haskell:8.6.3
2. The project name needs to be lowercased in several instances.
Steps to reproduce:
`stack new ServantDockerTest servant-docker`
`sudo docker-compose up`
1. "ERROR: no such image: ServantDockerTest: invalid reference format: repository name must be lowercase"
I go to docker-compose.yml and change line 3, 5, 15: to servantdockertest
```
version: '3'
services:
servantdockertest:
build: .
image: servantdockertest
command: ServantDockerTest
expose:
- "1234"
nginx:
build: ./nginx
image: nginx
ports:
- "8080:80"
depends_on:
- servantdockertest
```
2. The build will fail because of ghc mismatch. To get past this, I update the docker image to haskell:8.6.3 **or** I have to go into the stack.yaml and change the resolver from lts-13.4 to lts-11.8
3. sudo docker-compose up will still fail because the upstream can't be found. Have to edit the nginx.conf file for the upstream app.
`
upstream app {
server servantdockertest:1234;
}
`
`sudo docker-compose build`
`sudo docker-compose up`
And everything works.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.