2023-10-22 22:11:06 +02:00
|
|
|
FROM node:18 as builder
|
2019-08-03 18:03:16 +02:00
|
|
|
WORKDIR /maputnik
|
2019-02-27 13:50:27 +01:00
|
|
|
|
2019-08-03 18:03:16 +02:00
|
|
|
# Only copy package.json to prevent npm install from running on every build
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN npm install
|
2016-11-09 15:08:38 +01:00
|
|
|
|
2019-08-03 18:03:16 +02:00
|
|
|
# Build maputnik
|
|
|
|
# TODO: we should also do a npm run test here (needs more dependencies)
|
|
|
|
COPY . .
|
|
|
|
RUN npm run build
|
2016-11-09 15:08:38 +01:00
|
|
|
|
2019-08-03 18:03:16 +02:00
|
|
|
#---------------------------------------------------------------------------
|
2016-11-09 15:08:38 +01:00
|
|
|
|
2019-08-03 18:03:16 +02:00
|
|
|
# Create a clean python-based image with just the build results
|
|
|
|
FROM python:3-slim
|
|
|
|
WORKDIR /maputnik
|
2016-11-09 15:08:38 +01:00
|
|
|
|
2019-08-03 18:03:16 +02:00
|
|
|
COPY --from=builder /maputnik/build/build .
|
2016-11-09 15:08:38 +01:00
|
|
|
|
2019-08-03 18:03:16 +02:00
|
|
|
EXPOSE 8888
|
|
|
|
CMD python -m http.server 8888
|