Skip to content

Commit

Permalink
build(ci): improved docker container building
Browse files Browse the repository at this point in the history
  • Loading branch information
aap01 committed Apr 8, 2024
1 parent cf48a9e commit 15a5690
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ services:
context: .
args:
api_port: ${api_port}

ports:
- "${api_port}:8200"
restart: unless-stopped
Expand All @@ -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"
Expand Down
23 changes: 3 additions & 20 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 . .

Expand Down

0 comments on commit 15a5690

Please sign in to comment.