feat: add Docker support, refactor DB layer, update API responses

This commit is contained in:
dmit.b
2026-05-08 16:38:57 +03:00
parent 9ecbc3aa79
commit cd85f5f2db
12 changed files with 568 additions and 74 deletions
+41
View File
@@ -0,0 +1,41 @@
FROM dart:3.10.1 AS builder
WORKDIR /app
# Copy only pubspec files first for better caching
COPY pubspec.yaml pubspec.lock ./
# Install dependencies
RUN dart pub get
# Copy all source files
COPY . .
# Build the Dart application
RUN dart pub get && dart compile exe bin/server.dart -o bin/server.exe
# Production stage
FROM debian:bookworm-slim AS production
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the compiled executable from builder
COPY --from=builder /app/bin/server.exe ./bin/server.exe
# Set environment variables
ENV PORT=9090
ENV POSTGRES_HOST=localhost
ENV POSTGRES_PORT=5432
ENV POSTGRES_DB=family_safety
ENV POSTGRES_USER=postgres
ENV POSTGRES_PASSWORD=postgres
ENV JWT_SECRET=your-super-secret-key-change-me
ENV TOKEN_LIFETIME=600
EXPOSE 9090
CMD ["./bin/server.exe"]