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

docker-compose up does not work #3075

Closed
dmfenton opened this issue May 31, 2016 · 12 comments · Fixed by #4499
Closed

docker-compose up does not work #3075

dmfenton opened this issue May 31, 2016 · 12 comments · Fixed by #4499
Assignees

Comments

@dmfenton
Copy link

dmfenton commented May 31, 2016

The way that you are specifying environmental variables in these lines is incorrect: https://github.com/ckan/ckan/blob/master/contrib/docker/my_init.d/50_configure#L36-L49

As a result the CKAN container cannot connect to the DB or SOLR

ckan | *** Running /etc/my_init.d/50_configure...
ckan | /etc/my_init.d/50_configure: 37: /etc/my_init.d/50_configure: DB_ENV_POSTGRES_USER: parameter not set
ckan | no DATABASE_URL specified and linked container called 'db' was not found
ckan | *** /etc/my_init.d/50_configure failed with status 1
ckan |
ckan | *** Killing all processes...
ckan exited with code 1

I added the ENV's for DATABASE_URL and SOLR_URL directly into docker-compose.yml and everything works.

version: '2'
services:
  ckan:
    container_name: ckan
    image: ckan/ckan:latest
    depends_on:
      - db
      - solr
    links:
       - db
       - solr
    ports:
       - "80:80"
    environment:
       DATABASE_URL: "postgresql://ckan:ckan@db:5432/ckan"
       SOLR_URL: "http://solr:8983/solr/ckan"
  db:
    container_name: db
    image: ckan/postgresql:latest
  solr:
    container_name: solr
    image: ckan/solr:latest

My Docker version info:

$ docker version                                                                                                                      [16:37:48]
Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 22:37:33 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:20 2016
 OS/Arch:      linux/amd64
@deinok
Copy link
Member

deinok commented May 31, 2016

It's a know issue, im working improving the docker image of ckan, you can use the docker-cloud.yml in http://cloud.docker.com for now, or follow this legacy instructions http://docs.ckan.org/en/ckan-1.3.3/maintaining/installing/install-using-docker.html#installing-ckan

The actual image is not ready for production, CMD script and CKAN docker image needs to be full rewrite

@dmfenton
Copy link
Author

dmfenton commented May 31, 2016

Why not update the docker compose file until that work is done?

@deinok
Copy link
Member

deinok commented May 31, 2016

Because it docker-compose.yml should work without that ENV, they are in the postgres image, the link between the containers works well, but https://github.com/ckan/ckan/blob/master/contrib/docker/my_init.d/50_configure should handle that, but is going to be rewrited. I will rewrite it less than a week, on this sunday will be PR with the stability improvements and size reduced.

@dmfenton
Copy link
Author

Any update on this?

@deinok
Copy link
Member

deinok commented Jun 25, 2016

I'm looking the documentation, for some reason, when using docker run -d -p 80:80 --link db:db --link solr:solr ckan/ckan but docker-compose dont detect the ENV of the links.
Also we are moving the base image to https://hub.docker.com/_/httpd/
I'm having problems to serve CKAN and its WSGI

@dmfenton
Copy link
Author

dmfenton commented Jun 25, 2016

That's because envs and links are deprecated. I'd recommend using the docker network feature instead. Then the containers can communicate via service name quite easily. I'm working on an implementation and will share when I finish.

If you do want to use the link feature, instead of looking for an env, you can still just use the container name as a URL e.g. solr or postgres

@rwillmer
Copy link

Any news on this?

@dmfenton
Copy link
Author

@rwillmer I have a working implementation here: https://github.com/dmfenton/ckan-docker

@rwillmer
Copy link

thanks @dmfenton

@deinok
Copy link
Member

deinok commented Jan 14, 2017

@dmfenton Should be fixed, can you check it?

@3vivekb
Copy link

3vivekb commented Feb 28, 2017

We have a pretty far along build https://github.com/vta/Open-Data-Portal

frafra added a commit to frafra/ckan that referenced this issue Oct 15, 2018
frafra added a commit to frafra/ckan that referenced this issue Oct 16, 2018
frafra added a commit to frafra/ckan that referenced this issue Dec 7, 2018
@kmbn
Copy link
Contributor

kmbn commented Jan 22, 2019

We decided to close old issues that are not actively worked on so that we can focus our effort and attention on issues affecting the current versions of CKAN.

If this issue is still affecting the version of CKAN you're working with now, please feel free to comment or reopen the issue.

If you do reopen this issue, please update it with new details. One reason it might not have been resolved in the past is that it wasn't clear how a contributor could address the issue.

@kmbn kmbn closed this as completed Jan 22, 2019
n-a-t-e pushed a commit to cioos-siooc/ckan that referenced this issue Apr 23, 2019
fostermh pushed a commit to cioos-siooc/ckan that referenced this issue Sep 10, 2021
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

Successfully merging a pull request may close this issue.

5 participants