-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathdev.Dockerfile
44 lines (31 loc) · 1.01 KB
/
dev.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
# Run with context of the upper level directory
#
# Stage 1: Core
#
FROM node:20.18.0 AS builder
WORKDIR /app
COPY package.json package-lock.json lerna.json ./
COPY cli/ /app/cli/
COPY core/ /app/core/
RUN npm install
RUN npm run bootstrap
RUN npx lerna run build --scope mongo-seeding
RUN npx lerna run build --scope mongo-seeding-cli
#
# Stage 3: Final Docker image
#
FROM node:20.18.0
LABEL org.opencontainers.image.title="Mongo Seeding" \
org.opencontainers.image.description="The ultimate solution for populating your MongoDB database." \
org.opencontainers.image.url="https://mongo-seeding.kosiec.dev" \
org.opencontainers.image.documentation="https://mongo-seeding.kosiec.dev" \
org.opencontainers.image.source="https://github.com/pkosiec/mongo-seeding" \
org.opencontainers.image.version="dev" \
org.opencontainers.image.licenses="MIT"
WORKDIR /app
COPY --from=builder /app/cli/ /app/
# Create a symlink
RUN npm i --omit=optional --omit=dev && \
npm link
WORKDIR /data
CMD seed