forked from velo-cite/compteurs-velo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (28 loc) · 934 Bytes
/
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
FROM node:20.6.1-alpine3.18 AS build
# Set working directory
WORKDIR /compteurs
# Install dependencies
ADD package.json .
ADD yarn.lock .
RUN yarn install
# Download counters data
RUN mkdir public \
&& wget "https://opendata.bordeaux-metropole.fr/api/explore/v2.1/catalog/datasets/pc_velo_p/exports/csv?lang=fr&timezone=Europe%2FBerlin&use_labels=true&delimiter=%3B" -O public/compteurs.csv
# Rename headers
ADD scripts/rename-header-compteurs-csv.sh scripts/
RUN apk add sed # The default alpine sed can't handle hexadecimal characters
RUN ./scripts/rename-header-compteurs-csv.sh
# Prepare the data
ADD prepare.js .
ADD public/metadata.csv public/
RUN mkdir public/data \
&& yarn prep
# Add source code
ADD . .
# Build the pages
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN yarn build
####
FROM nginx:1.25.2-alpine
COPY --from=build /compteurs/out/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/conf.d/default.conf