Primer intento docker
This commit is contained in:
parent
13612e7601
commit
4a42dc49d9
2 changed files with 30 additions and 0 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Use the official Flutter SDK image
|
||||
FROM cirrusci/flutter:latest
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the pubspec.yaml and install dependencies
|
||||
COPY pubspec.yaml pubspec.lock ./
|
||||
RUN flutter pub get
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the Flutter app for Android
|
||||
RUN flutter build apk --release
|
||||
|
||||
# Use the following entrypoint if you want to run the app in a container
|
||||
# ENTRYPOINT ["flutter", "run", "--release"]
|
||||
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
flutter:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- .:/app # Link the current directory to /app in the container
|
||||
environment:
|
||||
- FLUTTER_FLAVOR=prod # Example environment variable, adjust as needed
|
||||
command: flutter build apk --release # You can run any Flutter command here
|
||||
Loading…
Reference in a new issue