scientry-backend / Dockerfile
raannakasturi's picture
Upload 28 files
14459e2 verified
raw
history blame contribute delete
537 Bytes
# ----------- Stage 1: Build -----------
FROM dart:stable AS build
WORKDIR /app
# Copy and resolve dependencies
COPY pubspec.* ./
RUN dart pub get
# Copy all source code
COPY . .
# Compile to a native executable
RUN dart compile exe bin/main.dart -o bin/main
# ----------- Stage 2: Runtime -----------
FROM scratch
# Hugging Face Spaces expose port 7860
EXPOSE 7860
# Copy AOT runtime + compiled server binary
COPY --from=build /runtime/ /
COPY --from=build /app/bin/main /app/bin/main
# Final start command
CMD ["/app/bin/main"]