File tree 4 files changed +63
-7
lines changed
4 files changed +63
-7
lines changed Original file line number Diff line number Diff line change 1
1
FROM nginx:1.10.1-alpine
2
2
3
- ADD ./preconfigure .sh /preconfigure .sh
3
+ ADD ./config .sh /config .sh
4
4
COPY ./autosize.js /usr/share/nginx/html
5
+ COPY ./vars.sh /vars.sh
5
6
6
- # Documentation
7
- # EXPOSE 80
8
7
9
- RUN chmod +x ./preconfigure .sh
10
- CMD ./preconfigure .sh
8
+ RUN chmod +x /config .sh
9
+ CMD /config .sh
Original file line number Diff line number Diff line change
1
+ # /bin/bash
2
+
3
+ # retrieve variables from vars.sh
4
+ source ./vars.sh
5
+
6
+ set -e
7
+
8
+ echo " using Tile Server: $TILESERVER "
9
+ echo " attribution: $ATTRIBUTION "
10
+
11
+ cat << HERE >/usr/share/nginx/html/index.html
12
+ <!DOCTYPE html>
13
+ <html>
14
+ <head>
15
+ <title>${TITLE} </title>
16
+ <meta charset="utf-8" />
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
19
+ <style>
20
+ body {
21
+ padding: 0px;
22
+ margin: 0px;
23
+ height: 100%;
24
+ width: 100%;
25
+ }
26
+ #map {
27
+ width: 100%;
28
+ height: 100%;
29
+ }
30
+ </style>
31
+ </head>
32
+ <body>
33
+ <div id="map"></div>
34
+ <script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
35
+ <script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js"></script>
36
+ <script src="autosize.js"></script>
37
+ <script>
38
+ Autosize.enable();
39
+ var map = L.map('map').setView([${DEFAULT_LAT} , ${DEFAULT_LON} ], ${DEFAULT_SCALE} );
40
+ L.tileLayer('${TILESERVER} ', {
41
+ attribution: '${ATTRIBUTION} '
42
+ })
43
+ .addTo(map);
44
+ </script>
45
+ </body>
46
+ </html>
47
+ HERE
48
+
49
+ nginx -g " daemon off;"
Original file line number Diff line number Diff line change 1
1
version : ' 3.3'
2
2
services :
3
3
nginx-leafletjs :
4
+ container_name : leaflet
5
+ image : nginx-leafletjs:latest
6
+ restart : always
4
7
ports :
5
8
- ' 8777:80'
6
- image : freecandy/nginx-leafletjs
7
- restart : always
Original file line number Diff line number Diff line change
1
+ TITLE=" Docker Leaflet"
2
+ DEFAULT_LAT=" 34.54"
3
+ DEFAULT_LON=" -112.47"
4
+ DEFAULT_SCALE=" 14"
5
+
6
+ TILESERVER=" http://{s}.tile.osm.org/{z}/{x}/{y}.png"
7
+ ATTRIBUTION=" © <a href=\" http://osm.org/copyright\" >OpenStreetMap</a> contributors"
You can’t perform that action at this time.
0 commit comments