-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add earthfile for voices fronted (#263)
- Loading branch information
Showing
7 changed files
with
115 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
VERSION --try --global-cache 0.7 | ||
|
||
deps: | ||
FROM debian:stable-slim | ||
RUN apt-get update | ||
RUN apt-get install -y curl git unzip bash | ||
WORKDIR /frontend | ||
|
||
# Download and set-up flutter | ||
flutter: | ||
FROM +deps | ||
|
||
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter | ||
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}" | ||
|
||
RUN flutter channel stable | ||
RUN flutter upgrade | ||
RUN flutter --version | ||
RUN flutter doctor -v | ||
RUN flutter config --enable-web | ||
|
||
# Build web version of Catalyst Voices | ||
build: | ||
FROM +flutter | ||
|
||
COPY --dir pubspec.yaml lib packages web test test_driver integration_test . | ||
|
||
RUN flutter clean | ||
RUN flutter pub get | ||
RUN flutter build web --web-renderer canvaskit --release --target lib/configs/main_web.dart | ||
|
||
WORKDIR /frontend/build | ||
SAVE ARTIFACT web /web AS LOCAL web | ||
|
||
docker: | ||
FROM +deps | ||
FROM nginx:stable-alpine3.17 | ||
|
||
COPY +build/web /app | ||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
|
||
EXPOSE 80 | ||
|
||
package: | ||
FROM +docker | ||
|
||
ARG tag='latest' | ||
|
||
SAVE IMAGE catalyst-voices-app:$tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'package:catalyst_voices/app/app.dart'; | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
|
||
void main() async { | ||
await bootstrap(() => const App()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
user nginx; | ||
worker_processes 1; | ||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
access_log /var/log/nginx/access.log main; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
location / { | ||
root /app; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters