diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aaaf2bc..835de4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,6 @@ jobs: - name: Build and deploy the containers run: | # stop, delete containers, delete volumes - docker compose down -v # build without cache docker compose build --no-cache docker compose up -d diff --git a/docker-compose.yml b/docker-compose.yml index 9423dad..703eb7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,6 @@ services: context: . args: api_port: ${api_port} - ports: - "${api_port}:8200" restart: unless-stopped @@ -18,6 +17,7 @@ services: context: ./ui args: api_base_url: ${api_base_url} + flutter_version: 3.19.3 ports: # served by nginx; nginx runs on port 80 inside the docker container - "${ui_port}:80" diff --git a/ui/Dockerfile b/ui/Dockerfile index 53631b5..1a1d20c 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -1,24 +1,6 @@ -# Environemnt to install flutter and build web -FROM debian:latest AS build-env +ARG flutter_version -# install all needed stuff -RUN apt-get update -RUN apt-get install -y curl git unzip - -# define variables -ARG FLUTTER_SDK=/usr/local/flutter -ARG FLUTTER_VERSION=3.19.3 -ARG api_base_url - -#clone flutter -ENV GIT_HTTP_LOW_SPEED_LIMIT=1000 -ENV GIT_HTTP_LOW_SPEED_TIME=60 -RUN git clone https://github.com/flutter/flutter.git $FLUTTER_SDK -# change dir to current flutter folder and make a checkout to the specific version -RUN cd $FLUTTER_SDK && git fetch && git checkout $FLUTTER_VERSION - -# setup the flutter path as an enviromental variable -ENV PATH="$FLUTTER_SDK/bin:$FLUTTER_SDK/bin/cache/dart-sdk/bin:${PATH}" +FROM ghcr.io/cirruslabs/flutter:${flutter_version} AS build-env # Start to run Flutter commands # doctor to see if all was installes ok @@ -27,6 +9,7 @@ RUN flutter doctor -v # stup new folder as the working directory ENV WORKDIR=/doculaboration WORKDIR $WORKDIR + # copy source code to folder COPY . .