-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (37 loc) · 1.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# syntax=docker/dockerfile:1.8
# ^ needed for ADD --checksum=…
FROM node:22-alpine
WORKDIR /app
LABEL org.opencontainers.image.title="gtfs-rt-feed"
LABEL org.opencontainers.image.description="Continuously Matches realtime VDV-454 transit data against GTFS Schedule and generates GTFS Realtime."
LABEL org.opencontainers.image.authors="Verkehrsverbund Berlin Brandenburg <[email protected]>"
# install dependencies
ADD package.json /app
RUN npm install --production
# install tools
# - bash, ncurses (tput), moreutils (sponge), postgresql-client (psql), unzip & zstd are required by postgis-gtfs-importer.
# - curl is required by curl-mirror, which is required by postgis-gtfs-importer.
RUN apk add --update --no-cache \
bash \
curl \
ncurses \
moreutils \
postgresql-client \
unzip \
zstd
# install curl-mirror
RUN curl -fsSL \
'https://gist.github.com/derhuerst/745cf09fe5f3ea2569948dd215bbfe1a/raw/9d145086ba239f05b20b6b984fa49563bd781194/mirror.mjs' \
-H 'User-Agent: OpenDataVBB/gtfs-rt-feed Docker build' \
-o /usr/local/bin/curl-mirror \
&& chmod +x /usr/local/bin/curl-mirror \
&& curl-mirror --help >/dev/null
# install PostGIS GTFS importer
ADD postgis-gtfs-importer /app/postgis-gtfs-importer
RUN \
cd postgis-gtfs-importer \
&& npm install --production \
&& npm cache clean --force
# add source code
ADD . /app
CMD [ "node", "index.js"]