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