Skip to content

Commit 6ce4742

Browse files
simono41Simon Rieger
and
Simon Rieger
authored
fix docker build (#769)
* fix docker build * fix docker build * fix docker build * add EXPOSE to Dockerfile and edit selfhosting file --------- Co-authored-by: Simon Rieger <[email protected]>
1 parent e8c44f5 commit 6ce4742

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

app/Dockerfile Dockerfile

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# Install Operating system and dependencies
2-
FROM ubuntu:22.04 AS builder
2+
FROM ubuntu:24.04 AS builder
33

44
RUN apt-get update
5-
RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 libglu1-mesa fonts-droid-fallback lib32stdc++6 python3
5+
RUN apt-get install -y curl git wget unzip gdb libstdc++6 libglu1-mesa fonts-droid-fallback python3 yq
66
RUN apt-get clean
77

8-
RUN mkdir /app/
9-
COPY . /app
10-
WORKDIR /app
8+
RUN mkdir /flutter_app/
9+
COPY . /flutter_app
10+
WORKDIR /flutter_app/app
11+
1112
# download Flutter SDK from Flutter Github repo
12-
RUN git clone https://github.com/flutter/flutter.git -b $(cat /FLUTTER_VERSION) /usr/local/flutter
13+
RUN git clone https://github.com/flutter/flutter.git -b $(yq '.environment.flutter' /flutter_app/app/pubspec.yaml -r) /usr/local/flutter
1314

1415
# Set flutter environment path
1516
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}"
17+
1618
# Run flutter doctor
1719
RUN flutter doctor
1820

@@ -21,8 +23,10 @@ RUN flutter config --enable-web
2123
# Copy files to container and build
2224
RUN flutter build web
2325

26+
# Nginx Container
2427
FROM nginx:alpine
2528

26-
RUN mkdir /app/
29+
EXPOSE 80
30+
2731
# Copy build/web in container to /app/
28-
COPY --from=builder ./build/web /usr/share/nginx/html
32+
COPY --from=builder /flutter_app/app/build/web /usr/share/nginx/html

docker-compose.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
butterfly:
3+
build:
4+
context: .
5+
container_name: butterfly
6+
#ports:
7+
# - "3000:80"
8+
restart: always

docs/src/content/docs/downloads/selfhosting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ All the files are in the `app/build/web` directory.
2222
## Docker
2323

2424
Clone the repository and build the `Dockerfile` using: `docker build -t linwood-butterfly`.
25-
Start the server using: `docker run -p 8080:8080 -d linwood-butterfly`.
25+
Start the server using: `docker run -p 8080:80 -d linwood-butterfly`.

0 commit comments

Comments
 (0)