Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/pages/reference/custom-containers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,35 @@ RUN apk update && \
ENTRYPOINT ["/bin/main"]
```

```docker {{ title: "Dart" }}
FROM dart:stable AS build

ARG HANDLER

WORKDIR /app/

# Resolve app dependencies.
COPY pubspec.* ./
RUN dart pub get

# Ensure the ./bin folder exists
RUN mkdir -p ./bin

# Copy app source code and AOT compile it.
COPY . .

# Ensure packages are still up-to-date if anything has changed
RUN dart pub get --offline
RUN dart compile exe ./${HANDLER} -o bin/main

FROM alpine

COPY --from=build /runtime/ /
COPY --from=build /app/bin/main /app/bin/

ENTRYPOINT ["/app/bin/main"]
```

</CodeGroup>

### Create an ignore file
Expand Down
Loading