Browse Source

feat(app): Add Dockerfile for web

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/372/head
jld3103 1 year ago
parent
commit
5ba8fe384d
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 1
      .cspell/misc.txt
  2. 10
      .dockerignore
  3. 20
      packages/app/Dockerfile
  4. 4
      packages/app/nginx.conf

1
.cspell/misc.txt

@ -9,3 +9,4 @@ postmarket
provokateurin
subroutes
uncategorized
leoafarias

10
.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

20
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

4
packages/app/nginx.conf

@ -0,0 +1,4 @@
server {
listen 8080;
root /usr/share/nginx/html;
}
Loading…
Cancel
Save