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

Create Docker for Tilemill releases #2742

Open
csytsma opened this issue Jun 13, 2021 · 16 comments
Open

Create Docker for Tilemill releases #2742

csytsma opened this issue Jun 13, 2021 · 16 comments

Comments

@csytsma
Copy link
Member

csytsma commented Jun 13, 2021

Goal: Create a Docker image for Tilemill that works for Ubuntu, MacOS and Windows. This will help with new users to be able to easily setup and start using Tilemill.

Do we have any takers that can help create the Docker image, and add it to the repo?

@apbarratt
Copy link

Working on this. Once I have something actually usable, I'll come back here and figure out what the best way to contribute it will be.

@apbarratt
Copy link

I should probably point out that whilst I was aiming to make it reusable, it was really just a personal project so will likely need some one to fork it to make it a little more polished for sharing around =D

@csytsma
Copy link
Member Author

csytsma commented Jun 14, 2021

@apbarratt This will be great. I have some co-workers that are big Docker users, so I'm sure I can get one of them to help "productionize" anything you create.

@apbarratt
Copy link

Have we a discord server anywhere for when I have quicky questions to ask? :)

@csytsma
Copy link
Member Author

csytsma commented Jun 14, 2021

We don't. I've thought about setting up a Slack instance. I'd prefer Slack over discord. Would that work?

@csytsma
Copy link
Member Author

csytsma commented Jun 14, 2021

@apbarratt Take a look at #2736, the Dockerfile may have already been created by someone.

@apbarratt
Copy link

Oh yes, there's a few of them around. But I'm wanting something a little friendlier. Something that'll just host the lot of port 80 and have the database and OSM-bright etc already there, ready to go.
It's the last bit I'm finding tricky.

@apbarratt
Copy link

Here's the basic tilemill anyway. All runs using port 80, so once it's running, you can just have it loaded up by going to localhost in your browser.
https://github.com/apbarratt/docker_tilemill

@Stoiker
Copy link
Contributor

Stoiker commented Sep 17, 2021

Thanks @apbarratt for your work! I am currently trying to reduce the overall image size and to create a version that will also work with podman. As one migh have guessed, the change to alpine is not straightforward and maybe someone can help me out here.

Out of the box, one runs into linker issues:

Error: Error relocating /tilemill/node_modules/gdal/lib/binding/node-v57-linux-x64/gdal.node: __printf_chk: symbol not found

which can/should be solved when building gdal explicitly with shared libs
npm install gdal --build-from-source --shared_gdal

Which would install the most up to date version and that relies on node v 10++
Use of a specific version
npm install gdal@0.8.0 --build-from-source --shared_gdal
only leads to futher compile errors with gyp

TypeError: write() argument must be str, not bytes while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 5.13.15-100.fc33.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tilemill/node_modules/mapnik/lib/binding/mapnik.node" "--module_name=mapnik" "--module_path=/tilemill/node_modules/mapnik/lib/binding"
gyp ERR! cwd /tilemill/node_modules/mapnik
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

Since I am lacking experience with the whole node dependency stack, can someone point me into the right direction?
Thx

@xycarto
Copy link

xycarto commented Sep 30, 2021

@csytsma Regarding your question about Slack from 15 June. That would be helpful at least for me

@Stoiker
Copy link
Contributor

Stoiker commented Oct 7, 2021

Just to let you know, I dumped the alpine approach and settled for a two stage build with node and node-slim images.
PR can be found here: #2748

Also, could someone verify if this setup is working for them as well?
I tested it with Docker under Ubuntu 20.04.03 in a VM.

@xycarto
Copy link

xycarto commented Dec 16, 2021

I set up and tested this on Ubuntu 20.04. No VM.

Did as suggested in README:

git clone https://github.com/tilemill-project/tilemill.git
cd tilemill
docker-compose up

No issues. Runs great. Connections to my PostgreSQL databases work as expected.

Great job

@Stoiker
Copy link
Contributor

Stoiker commented Dec 16, 2021

@xycarto great! Thx for testing!

@SaidAlSouti
Copy link

Tested on Mac apple silicon. It shows error when running docker-compose
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/src/app/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/usr/src/app/node_modules/mapnik/lib/binding' (1)

@Stoiker
Copy link
Contributor

Stoiker commented Mar 24, 2022

Hi @SaidAlSouti thx for your comment. Sadly, I don't own an apple silicon based device, hence I can not verify this issue.
Can you post more output (if there is anything meaningful regarding the mapnik issue)?

@csytsma
Copy link
Member Author

csytsma commented Aug 25, 2022

PR #2758 was created to fix Apple M1 issue, hoping someone on this thread can test and verify the fix.

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

No branches or pull requests

5 participants