-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
35 lines (25 loc) · 808 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
# Use an official Node.js runtime as a parent image
FROM node:22-slim AS builder
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json first
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the application files to the container
COPY . .
# Create a new stage for the final image
FROM node:22-slim
# Install bc and upgrade npm (as root)
RUN apt-get update && apt-get install -y bc
RUN npm i -g npm@latest
# Create folder for data mapping and set ownership (as root)
RUN mkdir -p /data
VOLUME /data
# Copy all files from the builder stage
COPY --from=builder /app /app
WORKDIR /app
# Make the shell script executable (as root)
RUN chmod +x /app/generate_tiles.sh
# Entrypoint to allow running commands
ENTRYPOINT ["/app/generate_tiles.sh"]