R
Railway16mo ago
ryans

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:
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...
Jump to solution
14 Replies
Percy
Percy16mo ago
Project ID: N/A
ryans
ryansOP16mo ago
N/A
Solution
Brody
Brody16mo ago
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
Brody
Brody16mo ago
these configurations are done in a nixpacks.toml file
ryans
ryansOP16mo ago
Thanks. Where do I put the file? I just need to run “playwright install”. I’ve only used preconfigured settings before
Brody
Brody16mo ago
you'd put that file in your project folder
ryans
ryansOP16mo ago
So will it do pip install requirements, then playwright install, then start flask app?
Brody
Brody16mo ago
pip install -r requirements is already done by default for you have you checked out the document fragment I linked?
ryans
ryansOP16mo ago
I’m on mobile. Will check it out later and reply back. Thank you
Brody
Brody16mo ago
sounds good
ryans
ryansOP16mo ago
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
Brody
Brody16mo ago
I mean I would have choose to call the phase playwrite instead of build but you do you lol
ryans
ryansOP16mo ago
@Brody noted, so you suggest: [phases.playwright] cmds = ["playwright install"] dependsOn = ["install"]
Brody
Brody16mo ago
yep, looks good to me
Want results from more Discord servers?
Add your server