-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dockerfile, fixed firebase depndencies
- Loading branch information
Showing
8 changed files
with
537 additions
and
665 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,6 @@ app.*.map.json | |
|
||
# Firebase | ||
public/ | ||
|
||
# Env files | ||
.env.electricity-assistant-fb2f7 |
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,36 @@ | ||
FROM --platform=linux/amd64 dart:stable AS build | ||
|
||
WORKDIR /app | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y curl git unzip xz-utils zip libglu1-mesa | ||
|
||
# Download and install Flutter SDK | ||
RUN curl -L https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.3-stable.tar.xz | tar xJ | ||
ENV PATH="/app/flutter/bin:${PATH}" | ||
|
||
# Copy the Flutter project files to the container | ||
COPY . . | ||
|
||
# Enable Flutter web | ||
RUN git config --global --add safe.directory /app/flutter | ||
RUN flutter upgrade | ||
RUN flutter config --enable-web | ||
|
||
# Get Flutter packages | ||
RUN flutter pub get | ||
|
||
# Build the web release version | ||
RUN flutter build web --release | ||
|
||
# Stage 2: Serve the app with Nginx | ||
FROM nginx:alpine | ||
|
||
# Copy the built app from the previous stage | ||
COPY --from=build /app/build/web /usr/share/nginx/html | ||
|
||
# Expose port 80 | ||
EXPOSE 80 | ||
|
||
# Start Nginx server | ||
CMD ["nginx", "-g", "daemon off;"] |
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
Oops, something went wrong.