Skip to content

ServantDocker doesn't work out of the box #137

@mac10688

Description

@mac10688

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions