playwright in a flask app
How can I install playwright in a flask app? On my local, I do playwright install after I install it with pip3. Please help. Thanks
Solution:Jump to solution
add a new phase that will run that command, have the phase depend on the pre-existing install phase
https://nixpacks.com/docs/guides/configuring-builds#new-phase...
14 Replies
Project ID:
N/A
N/A
Solution
add a new phase that will run that command, have the phase depend on the pre-existing install phase
https://nixpacks.com/docs/guides/configuring-builds#new-phase
these configurations are done in a nixpacks.toml file
Thanks. Where do I put the file? I just need to run “playwright install”.
I’ve only used preconfigured settings before
you'd put that file in your project folder
So will it do pip install requirements, then playwright install, then start flask app?
pip install -r requirements is already done by default for you
have you checked out the document fragment I linked?
I’m on mobile. Will check it out later and reply back. Thank you
sounds good
Is this correct for the file?
[phases.build]
cmds = ["playwright install"]
dependsOn = ["install"]
Getting this error:
#12 [stage-0 8/10] RUN playwright install
#12 0.371 /bin/bash: line 1: playwright: command not found
#12 ERROR: process "/bin/bash -ol pipefail -c playwright install" did not complete successfully: exit code: 127
-----
[stage-0 8/10] RUN playwright install:#12 0.371 /bin/bash: line 1: playwright: command not found ----- Dockerfile:24 ------------------- 22 | # build phase 23 | COPY . /app/. 24 | >>> RUN playwright install 25 | 26 | ------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c playwright install" did not complete successfully: exit code: 127 Error: Docker build failed oh wait, it actually worked nice
I mean I would have choose to call the phase
playwrite
instead of build
but you do you lol@Brody noted, so you suggest:
[phases.playwright]
cmds = ["playwright install"]
dependsOn = ["install"]
yep, looks good to me