diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/Dockerfile b/Dockerfile index 41bee7b..a143d14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,18 +14,13 @@ RUN apt-get update \ RUN mkdir -p ${WORK} -RUN npm install tessera \ - tilejson \ - tilelive-http \ - tilelive-otp-stops \ - tilelive-hsl-parkandride \ - mbtiles \ - tilelive-xray \ - forever +ADD . ${WORK} -RUN curl https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/finland.mbtiles > finland.mbtiles +RUN npm install -ADD xorg.conf ${WORK}/xorg.conf +#TODO: Replace when https://github.com/osm2vectortiles/osm2vectortiles/issues/114 is fixed +RUN curl http://koti.kapsi.fi/~hannes/tiles.mbtiles > finland.mbtiles +#RUN curl https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/finland.mbtiles > finland.mbtiles RUN npm install https://github.com/hannesj/tilelive-gl.git @@ -33,11 +28,10 @@ RUN npm install https://github.com/HSLdevcom/hsl-map-style.git RUN cd ${WORK}/node_modules/hsl-map-style && \ unzip -P ${FONTSTACK_PASSWORD} fontstack.zip && \ - sed -i -e "s#http://localhost:3000/#file://${WORK}/node_modules/hsl-map-style/#" hsl-gl-map-v8.json + sed -i -e "s#http://localhost:3000/#file://${WORK}/node_modules/hsl-map-style/#" hsl-gl-map-v8.json && \ + sed -i -e 's#dev.digitransit.fi/#localhost:8080/#' hsl-gl-map-v8.json -COPY config.js ${WORK}/ - -EXPOSE 8088 +EXPOSE 8080 #RUN chown -R 9999:9999 ${WORK} #USER 9999 @@ -45,7 +39,7 @@ EXPOSE 8088 CMD Xorg -dpi 96 -nolisten tcp -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./10.log -config ./xorg.conf :10 & \ sleep 15 && \ DISPLAY=":10" node_modules/.bin/forever start -c "node --harmony" \ - node_modules/tessera/bin/tessera.js --port 8088 --config config.js \ + node_modules/tessera/bin/tessera.js --port 8080 --config config.js \ -r ${WORK}/node_modules/tilelive-otp-stops/ \ -r ${WORK}/node_modules/tilelive-gl/ \ -r ${WORK}/node_modules/tilelive-hsl-parkandride \ diff --git a/package.json b/package.json new file mode 100644 index 0000000..d30cd44 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "hsl-map-server", + "version": "1.0.0", + "description": "HSL map server", + "main": "config.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/HSLdevcom/hsl-map-server.git" + }, + "author": "HSLdevcom", + "license": "(AGPL-3.0 OR EUPL-1.2)", + "bugs": { + "url": "https://github.com/HSLdevcom/hsl-map-server/issues" + }, + "homepage": "https://github.com/HSLdevcom/hsl-map-server#readme", + "dependencies": { + "forever": "^0.15.1", + "mbtiles": "^0.8.2", + "tessera": "^0.8.0", + "tilejson": "^1.0.1", + "tilelive-hsl-parkandride": "0.0.2", + "tilelive-http": "^0.10.0", + "tilelive-otp-stops": "^0.1.0", + "tilelive-xray": "^0.2.0" + } +}