-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (40 loc) · 1.13 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
ARG NODE_VERSION
FROM node:${NODE_VERSION}-bookworm-slim AS base
ENV SHELL=/bin/sh
#########################################
FROM base AS depskeleton
WORKDIR /app
COPY ./.moon/docker/workspace .
RUN corepack enable
#########################################
FROM depskeleton AS proddeps
WORKDIR /app
RUN yarn workspaces focus -A --production
#########################################
FROM proddeps AS devdeps
WORKDIR /app
RUN apt update && apt install -y ca-certificates
RUN yarn --immutable
#########################################
FROM devdeps AS sources
WORKDIR /app
COPY . .
#########################################
FROM sources AS build
WORKDIR /app
RUN yarn moon :build
#########################################
FROM build AS test
WORKDIR /app
RUN yarn moon '#testable:test'
#########################################
FROM sources AS lint
WORKDIR /app
RUN yarn moon :lint
#########################################
FROM base AS runtime
WORKDIR /app
COPY --from=proddeps /app/node_modules ./node_modules
ENV PATH="${PATH}:/app/packages/concourse-ts-cli/bin"
ENV NODE_PATH="${NODE_PATH}:/app/node_modules"
ENTRYPOINT [ "sh", "-eu" ]