jxstxn1 / dockerize Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
I'm running into this issue:
β― pq docker build
πͺ Building with sound null safety πͺ
Compiling lib/main.dart for the Web... 611ms
Creating image pascalq:dev
#1 [internal] load build definition from Dockerfile
#1 sha256:17c9e5d4c11bbfb110f145503ae2b7eff73a9f7544b4c33cd2552626af636148
#1 transferring dockerfile: 2B done
#1 DONE 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount362344577/Dockerfile: no such file or directory
Usage: You can execute the following commands:
β’ pq docker
β’ build Builds your project and the docker container
β’ run Runs the Docker Container on localhost:8000
-b, --build Calls the build command before running the app
-p, --port Set a custom entry port for the container
β’ stop Stops the currently running docker container
Seems like I'm missing a Dockerfile, but I haven't found it. Any idea what to do?
We should create the bin folder if it is not existing but server is already present
Currently, the container is tagged as $package_name:dev
, overriding the old container.
I'd love to have some documentation how to tag the container with a version
, i.e. the version from pubspec.yaml
Or maybe create a new option for building <cli> docker build --release
I want to be able to press ctrl-c just once to exit instead of twice
I think we reached the crucial points where we need tests and shouldnt life without them anymore.
As a user I want to build different containers for different environments like: dev, preprod or prod.
Commands would look like this:
docker build
--> Building dev if we dont specify anything
docker build --env=preprod
--> Build the container for preprod
docker run
--> runs the dev container
docker run --env=preprod
--> runs the preprod container
I guess the principe is clear
@robiness any Improvements and/or ideas?
ToΒ have a container started locally from scratch we now have to do 4 steps. For Example:
office sidekick plugins install --source path /Users/robin/testing/dockerize_sidekick_plugin
office dockerize
docker build -t app:dev .
docker run -it --rm -p 8000:8080 --name app app:dev
This may can be reduced. Especially the docker commands may can get merged.
The image (called app for the time being) could be named like the cli? π€
I think we should consider using mason_logger as CLI Logger because it has some nice abilities compared to the normal print like: Overwriting an already printed print or loading indicators
I think it would be quite nice if we could have a chrome instance which is reloading after a hot-reload
0 failed: port is already allocated.
Usage: You can execute the following commands:
β’ bam docker
β’ build Builds your project and the docker container
β’ run Runs the Docker Container on localhost:8000
-b, --build Calls the build command before running the app
-p, --port Set a custom entry port for the container
β’ stop Stops the currently running docker container
App is running on http://localhost:8000
If an error is occurring we should not print that the app is running or anything else.
I think we abstract the commands more to make it easily for users to run pre-/post-build code.
The command could look like this:
@override
Future<void> run() async{
// Insert your custom preBuildCode here:
flutter(
['build', 'web'],
workingDirectory: mainProject!.root,
);
// Insert your pre DockerBuild Code here:
buildDocker();
// Run your post Docker Build Code
}
@robiness your thoughts about this?
We should add the possibility to directly build containers for AWS and GCloud Run and maybe also the option to directly deploy them to the specific environment
I think it would be nice if we can support DartFrog next to Flutter Projects so that more people can benefit from the one command docker build
After running <cli> docker run
I can't see the log. The process completes right away.
Instead, I expected to see the log output and to stop the docker container with ctrl
+ C
.
To run it in the background I'd use <cli> docker run &
Currently the Port option is throwing if I enter a valid port
It also doesnt work if I overwrite the port manually
Currently we are creating a new version.json, we should instead just append our data
I think it would help to have something like a version.json to easily know some facts like: container_build_at and adding the possibility to add a Map<String, dynamic> to add more params by your own
We should dump our www folder before every build to ensure that it doesnt contain any old files.
I think we need some kind of readme in the server folder so that it is easier to orient in there and also be able to make changes faster without reading through each file to understand everything
We should add a flag or option to disable hot-reload.
Could be something like this: <<your_cli>> docker run --disable-hot-reload
We should somehow remove dangling docker images to prevent consuming 30mb diskspace after every hot reload
We should consider adding a nonce to helmet and the index.html to be able to remove unsafe-inline
and unsafe-eval
.
How I think it could work:
index.html
.middlewares.dart
and afterwards behind every script tag in the index.html
Edit:
TIL Nonce should be generated dynamically.
I'll try the same approach but with a sha256 hash
Edit2:
API will be that we probally can offer hash and nonce scripts, so users will have to add either 'sha256-'
/'sha384-'
/'sha512'
or 'nonce-'
to their script tags. The rest will be handled by us while building the container and serving the application
@robiness @passsy your thoughts about this
I wasn't able to get my Flutter app including firebase running easily running. I had to manually add new CSP rules with requires a lot of knowledge:
It would be easier for most if CSP would be disabled by default, but showing a warning at startup that it is not secure and not ready for production.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.