diff --git a/.cspell/misc.txt b/.cspell/misc.txt index 94f59994..9ede053f 100644 --- a/.cspell/misc.txt +++ b/.cspell/misc.txt @@ -9,3 +9,4 @@ postmarket provokateurin subroutes uncategorized +leoafarias diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..f5eb0812 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +**/.dart_tool +**/build +**/coverage +.git/ +external/ +packages/app/.flatpak-builder +packages/app/android +packages/app/build-dir +packages/app/linux +packages/app/screenshots diff --git a/packages/app/Dockerfile b/packages/app/Dockerfile new file mode 100644 index 00000000..6faab925 --- /dev/null +++ b/packages/app/Dockerfile @@ -0,0 +1,20 @@ +FROM leoafarias/fvm:latest as build + +# This is needed, because for some reason it doesn't work with the default user because of permissions +USER root +WORKDIR /app + +COPY .fvm/fvm_config.json .fvm/ +RUN fvm install +RUN fvm flutter config --enable-web +RUN fvm flutter precache + +# TODO: Efficiently cache dependencies + +COPY . . + +RUN cd packages/app && fvm flutter build web --no-web-resources-cdn + +FROM nginx:alpine +COPY packages/app/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/packages/app/build/web/ /usr/share/nginx/html diff --git a/packages/app/nginx.conf b/packages/app/nginx.conf new file mode 100644 index 00000000..b2c4aae9 --- /dev/null +++ b/packages/app/nginx.conf @@ -0,0 +1,4 @@ +server { + listen 8080; + root /usr/share/nginx/html; +}