From b6dd44cf9fd00bea0ba09a32ba5e75d0318525fd Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Thu, 29 Sep 2022 17:56:33 +0200 Subject: [PATCH] Docker file + remove host from login page --- Dockerfile | 22 ++++++++++++++++++++++ lib/Screens/login_screen.dart | 10 +++++----- 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1a237de --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +#Stage 1 - Install dependencies and build the app in a build environment +FROM debian:latest AS build-env +# Install flutter dependencies +RUN apt-get update +RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 libglu1-mesa fonts-droid-fallback lib32stdc++6 python3 sed +RUN apt-get clean +# Clone the flutter repo +RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter +# Set flutter path +ENV PATH="${PATH}:/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin" +# Run flutter doctor +RUN flutter doctor -v +RUN flutter channel master +RUN flutter upgrade +# Copy files to container and build +RUN mkdir /app/ +COPY . /app/ +WORKDIR /app/ +RUN flutter build web +# Stage 2 - Create the run-time image +FROM nginx:1.21.1-alpine +COPY --from=build-env /app/build/web /usr/share/nginx/html \ No newline at end of file diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index 615b8e0..3a1c6c4 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -113,9 +113,9 @@ class _LoginScreenState extends State { @override void initState() { this.isRememberMe = widget.session.rememberMe; - this.host = "http://localhost:5000"; //widget.session.host; // MDLF "http://192.168.1.19:8089" - this.email = "test@email.be"; //widget.session.email; - this.password = "kljqsdkljqsd"; //widget.session.password; + this.host = "https://api.mymuseum.be"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" + //this.email = "test@email.be"; //widget.session.email; + //this.password = "kljqsdkljqsd"; //widget.session.password; super.initState(); } @@ -160,14 +160,14 @@ class _LoginScreenState extends State { ], ), ), - RoundedInputField( + /*RoundedInputField( hintText: "Host", onChanged: (value) { host = value; }, initialValue: host, icon: Icons.home - ), + ),*/ RoundedInputField( hintText: "Email", onChanged: (value) {