Skip to content

Commit 7b5dcb3

Browse files
committed
feat(docker): Build the entire flutter app with docker
1 parent e2f7e52 commit 7b5dcb3

File tree

4 files changed

+19
-32
lines changed

4 files changed

+19
-32
lines changed

.github/workflows/build-release.yaml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,6 @@ jobs:
1717
with:
1818
ref: "web"
1919

20-
- name: Set Gradle Java Home
21-
run: sed -i '$d' frontend/android/gradle.properties
22-
23-
- name: Set Up Java
24-
uses: actions/setup-java@v3
25-
with:
26-
distribution: "oracle"
27-
java-version: "17"
28-
cache: gradle
29-
30-
- name: Set Up Flutter
31-
uses: subosito/flutter-action@v2
32-
with:
33-
flutter-version: "3.27.2"
34-
channel: "stable"
35-
cache: true
36-
37-
- name: Install Dependencies
38-
run: |
39-
cd frontend
40-
flutter pub get
41-
42-
- name: Build Web Files
43-
run: |
44-
cd frontend && flutter build web
45-
4620
- name: Log in to GitHub Container Registry
4721
uses: docker/login-action@v3
4822
with:

docker-compose-dev.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ services:
55
ports:
66
- 80:80
77
restart: unless-stopped
8-
depends-on: backend
8+
depends-on:
9+
- backend
910

1011
backend:
1112
container_name: slcm-backend
1213
build: backend
14+
ports:
15+
- 8000:8000
1316
restart: unless-stopped

docker-compose.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
frontend:
33
container_name: slcm-frontend
4-
image: ghcr.io/dk10ws/slcm-frontend:main
4+
image: ghcr.io/dk10ws/slcm-frontend:latest
55
ports:
66
- 80:80
77
restart: unless-stopped
@@ -10,5 +10,7 @@ services:
1010

1111
backend:
1212
container_name: slcm-backend
13-
image: ghcr.io/dk10ws/slcm-frontend:main
13+
image: ghcr.io/dk10ws/slcm-backend:latest
14+
ports:
15+
- 8000:8000
1416
restart: unless-stopped

frontend/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
FROM nginx:alpine-slim
1+
FROM ghcr.io/cirruslabs/flutter:latest AS builder
22

3-
COPY build/web /usr/share/nginx/html
3+
WORKDIR /app
4+
COPY . .
5+
6+
RUN flutter pub get
7+
RUN flutter build web
8+
9+
10+
FROM nginx:alpine-slim AS runner
11+
12+
COPY --from=builder /app/build/web /usr/share/nginx/html
413
COPY nginx.conf /etc/nginx/conf.d/default.conf
514

615
CMD ["nginx", "-g", "daemon off;"]
7-

0 commit comments

Comments
 (0)