Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServantDocker doesn't work out of the box #137

Open
mac10688 opened this issue Jan 24, 2019 · 0 comments
Open

ServantDocker doesn't work out of the box #137

mac10688 opened this issue Jan 24, 2019 · 0 comments

Comments

@mac10688
Copy link

mac10688 commented Jan 24, 2019

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

  1. 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

  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant