-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathDockerfile
37 lines (32 loc) · 955 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:18-slim as base
RUN apt-get update -y && apt-get install -y openssl && apt-get install -y wget2 && apt-get install -y curl && apt-get install -y git
FROM base AS install
WORKDIR /app
COPY package*.json ./
RUN npm install
FROM base as build
WORKDIR /app
COPY prisma ./prisma/
COPY --from=install /app/node_modules ./node_modules
RUN npx prisma generate
COPY . .
RUN npm run build
FROM base as data
WORKDIR /app
COPY --from=install /app/node_modules ./node_modules
COPY . .
RUN sed -i 's/\r$//' ./setup.sh
RUN chmod +x ./setup.sh
RUN ./setup.sh
FROM base
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/package*.json ./
COPY --from=build /app/prisma ./prisma
COPY --from=data /app/db.mmdb ./db.mmdb
COPY --from=data /app/src/geojson-data ./src/geojson-data
COPY ./src ./src
COPY tsconfig.json ./tsconfig.json
EXPOSE 3000
CMD ["npm", "run", "migrate:ingest:start:prod"]