-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 1.07 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
# Use latest stable channel SDK.
FROM dart:stable AS build
# Work Directory
WORKDIR /app
# Resolve app dependencies.
COPY pubspec.* ./
# Install the Vania cli from pub.dev
RUN dart pub global activate vania_cli
# Get dependencies
RUN dart pub get
# Copy app source code (except anything in .dockerignore) and AOT compile app.
COPY . .
# 📦 Create a production build
RUN dart pub get --offline
# Comment the following line if you don't want to create tables.
RUN vania migrate
RUN vania build
# Build minimal serving image from AOT-compiled `/server`
# and the pre-built AOT-runtime in the `/runtime/` directory of the base image.
FROM scratch
# Comment the following line if you are not serving static files.
COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /bin/server
COPY --from=build /app/.env /
COPY --from=build /app/public /public/
COPY --from=build /app/storage /storage/
COPY --from=build /app/lib/lang /lib/lang
COPY --from=build /app/lib/resources /lib/resources
# Expose the server port (useful for binding)
EXPOSE 8000
# Start server.
CMD ["/bin/server"]