参考:
dart-frog官网:https://dartfrog.vgv.dev/docs/overview
使用 'Dart Frog' 体验 Dart 服务端开发 - 简书
打包项目
按照demo新增项目后,执行:
dart_frog build
等待build后生成 build 文件夹,这个文件夹就是需要部署的内容
需要注意,由于环境问题,需要编辑一下 build/Dockerfile 文件:
# Official Dart image: https://hub.docker.com/_/dart
# Specify the Dart SDK base image version using dart:<version> (ex: dart:2.17)FROM dart:stable AS build
# 在此处添加PUB_HOSTED_URL 和 FLUTTER_STORAGE_BASE_URL
ENV PUB_HOSTED_URL="https://pub.flutter-io.cn"
ENV FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn"
WORKDIR /app# Copy Dependencies
# Install Dependencies
# Resolve app dependencies.
COPY pubspec.* ./
RUN dart pub get# Copy app source code and AOT compile it.
COPY . .
# Ensure packages are still up-to-date if anything ha