@davoodmehraban89 / LifeMate / commits / 4e75434
Fork 0

LifeMate — Personal, Family & Learning Companion

Deploy stable PWA and APK host

Build and serve the Flutter PWA and installable Android test APK from one stable Railway service using the existing staging API.

davoodmehraban89 committed Oct 5, 2026 at 22:06 UTC 4e75434055177193d6e9669ae97aef02a9215c10
2 files changed +48
apps/lifemate/Dockerfile new
+22
@@ -0,0 +1,22 @@
1 +FROM ghcr.io/cirruslabs/flutter:stable AS build
2 +WORKDIR /src
3 +
4 +COPY pubspec.yaml pubspec.lock ./
5 +RUN flutter pub get
6 +
7 +COPY . .
8 +
9 +RUN flutter build web --release \
10 + --dart-define=LIFEMATE_API_URL=https://lifemate-api-fn-staging.up.railway.app
11 +
12 +RUN flutter build apk --release \
13 + --dart-define=LIFEMATE_API_URL=https://lifemate-api-fn-staging.up.railway.app
14 +
15 +FROM nginx:1.27-alpine
16 +
17 +COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
18 +COPY --from=build /src/build/web /usr/share/nginx/html
19 +RUN mkdir -p /usr/share/nginx/html/downloads
20 +COPY --from=build /src/build/app/outputs/flutter-apk/app-release.apk /usr/share/nginx/html/downloads/LifeMate.apk
21 +
22 +EXPOSE 80
apps/lifemate/deploy/nginx.conf new
+26
@@ -0,0 +1,26 @@
1 +server {
2 + listen 80;
3 + server_name _;
4 +
5 + root /usr/share/nginx/html;
6 + index index.html;
7 +
8 + add_header X-Content-Type-Options nosniff always;
9 + add_header Referrer-Policy no-referrer always;
10 + add_header X-Frame-Options SAMEORIGIN always;
11 +
12 + location = /health {
13 + access_log off;
14 + add_header Content-Type text/plain;
15 + return 200 'ok';
16 + }
17 +
18 + location /downloads/ {
19 + add_header Cache-Control "public, max-age=300";
20 + try_files $uri =404;
21 + }
22 +
23 + location / {
24 + try_files $uri $uri/ /index.html;
25 + }
26 +}