-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (45 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
57 lines (45 loc) · 1.74 KB
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
ARG BASE=node
ARG BASE_VERSION=20-bookworm
FROM ${BASE}:${BASE_VERSION} AS build
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
ARG BASE
ARG BASE_VERSION
ENV BASE_VERSION=${BASE_VERSION}
WORKDIR /app
# System deps for building native modules and tools used by the monorepo
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates curl git python3 make g++; \
update-ca-certificates || true; \
corepack enable; \
corepack prepare pnpm@9.12.1 --activate; \
rm -rf /var/lib/apt/lists/*
# Copy full repo (build context must be repo root when building this image)
COPY . .
# Install and build all workspaces
RUN set -eux; \
pnpm install --frozen-lockfile; \
pnpm run build
################################################################################
FROM ${BASE}:${BASE_VERSION} AS launchql
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
WORKDIR /app
# Runtime deps (psql optional but handy for debugging)
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates postgresql-client; \
update-ca-certificates || true; \
corepack enable; \
corepack prepare pnpm@9.12.1 --activate; \
rm -rf /var/lib/apt/lists/*
# Copy built repo from builder
COPY --from=build /app /app
# Lightweight shims to expose CLI on PATH
RUN set -eux; \
install -d /usr/local/bin; \
printf '#!/usr/bin/env bash\nnode /app/packages/cli/dist/index.js "$@"\n' > /usr/local/bin/lql; \
printf '#!/usr/bin/env bash\nnode /app/packages/cli/dist/index.js "$@"\n' > /usr/local/bin/launchql; \
chmod +x /usr/local/bin/lql /usr/local/bin/launchql
ENTRYPOINT ["/usr/local/bin/lql"]
CMD ["--help"]