Skip to content

Commit 5664de6

Browse files
authored
Created Docker support with postgis instance (#2748)
Adapted README.md to indicate the new Docker support
1 parent 27eeaf8 commit 5664de6

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.dockerignore
2+
node_modules
3+
npm-debug.log
4+
Dockerfile
5+
.git
6+
.gitignore
7+
utils
8+
test

Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Build Stage
2+
FROM node:8.15 AS BUILD
3+
4+
WORKDIR /usr/src/app
5+
# Copy content of git repo to container
6+
COPY ./package.json /usr/src/app/
7+
COPY ./package-lock.json /usr/src/app/
8+
9+
RUN npm install --only=production && npm prune --production
10+
11+
# Production Stage
12+
FROM node:8.15-slim
13+
14+
# Copy tilemill and node modules to new container
15+
WORKDIR /usr/src/app
16+
COPY --chown=node:node --from=BUILD /usr/src/app/node_modules /usr/src/app/node_modules
17+
COPY --chown=node:node . /usr/src/app
18+
19+
RUN chmod 777 startdocker.sh
20+
21+
USER node
22+
# Export port for tiles
23+
EXPOSE 20008
24+
# Export port for webpage
25+
EXPOSE 20009
26+
27+
CMD ["node", "/usr/src/app/index.js", "--listenHost=0.0.0.0"]
28+

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,20 @@ Scripts have been created that will do most everything for you. They were writte
4343

4444
[Full Installation instructions can be found in the TileMill Documentation](https://tilemill-project.github.io/tilemill/docs/install/).
4545

46+
### Docker
47+
It is also possible to run tilemill as a docker container:
4648

49+
git clone https://github.com/tilemill-project/tilemill.git
50+
cd tilemill
51+
docker-compose up
52+
53+
This will host a docker container which uses the port 20008 and 20009 for tilemill, tilemill is then reachable under [http://localhost:20009](http://localhost:20009) .
54+
Additionally, a postgis instance is started as well which is reachable under
55+
56+
host=localhost port=5432 user=docker password=docker dbname=gis
57+
58+
Docker hosted volumes are used for the containers, hence if you want to use sqlite dbs you have to interact with those to get the dbs into the docker container.
59+
4760
# Build Status, Running Tests, Updating Documentation
4861

4962
See CONTRIBUTING.md

docker-compose.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: "3.3"
2+
services:
3+
postgis:
4+
image: kartoza/postgis:9.6-2.4
5+
volumes:
6+
- postgisVolume:/var/lib/postgresql
7+
environment:
8+
- POSTGRES_USER=docker
9+
- POSTGRES_PASS=docker
10+
- ALLOW_IP_RANGE=0.0.0.0/0
11+
ports:
12+
- "5432:5432"
13+
14+
tilemill:
15+
build:
16+
context: ./
17+
ports:
18+
- "20008:20008"
19+
- "20009:20009"
20+
volumes:
21+
- tilemillVolume:/home/node/
22+
environment:
23+
- PGPORT=5432
24+
- PGHOST=postgis
25+
- PGDATABASE=gis
26+
- PGUSER=docker
27+
- PGPASSWORD=docker
28+
depends_on:
29+
- postgis
30+
31+
volumes:
32+
postgisVolume:
33+
tilemillVolume:

0 commit comments

Comments
 (0)