-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
43 lines (35 loc) · 2.08 KB
/
Copy pathDockerfile.dev
File metadata and controls
43 lines (35 loc) · 2.08 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
# Image for the live "dev environment" service. Unlike the production app
# image, this one carries the FULL sample source tree — the coding agent edits
# it in place and the Next.js dev server hot-reloads the changes.
FROM node:22-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates debian-keyring debian-archive-keyring apt-transport-https gnupg \
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg \
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' > /etc/apt/sources.list.d/caddy-stable.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends caddy \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Defang CLI for the admin-triggered self-redeploy ("publish"). Installed from
# the latest NIGHTLY, resolved at build time: the publish flow needs recent GCE
# metadata authentication and stack-selected env-file support, and nightly
# release assets are replaced daily, so a pinned nightly asset URL would 404 on
# the next self-rebuild. TODO: re-pin to the first stable release containing
# those features. Builds happen remotely in the CD task, so no Docker daemon is
# needed here. Fabric auth is a per-publish interactive login; cloud auth comes
# from the AWS task role or GCP VM service account selected by the stack.
ARG TARGETARCH=amd64
RUN url=$(curl -fsSL https://api.github.com/repos/DefangLabs/defang/releases/tags/nightly \
| grep -o "https://[^\"]*linux_${TARGETARCH}\.tar\.gz" | head -1) \
&& echo "installing defang CLI from $url" \
&& curl -fsSL "$url" | tar -xz -C /usr/local/bin defang \
&& defang --version
# Install dependencies first for better layer caching.
COPY todo-app/package.json todo-app/package-lock.json ./todo-app/
RUN cd todo-app && npm ci
COPY agent/package.json agent/package-lock.json ./agent/
RUN cd agent && npm ci
# The rest of the source tree — this is what the agent edits at runtime.
COPY . .
EXPOSE 3000 8081
CMD ["./entrypoint.dev.sh"]