R
Railway10mo ago
loyahdev

problems when trying to install a requirements.txt in a nodejs and python project

I was trying to use chatgpt to help with this being my docker file:
# Use an official Node runtime as a parent image
FROM node:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install Node.js dependencies
RUN npm install

# Install Python and other necessary tools
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
git

# Run the install-pyzule.sh script
RUN bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"

# Copy the requirements.txt file and install Python packages
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt

# Copy the rest of your application into the container
COPY . .

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
# Use an official Node runtime as a parent image
FROM node:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install Node.js dependencies
RUN npm install

# Install Python and other necessary tools
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
git

# Run the install-pyzule.sh script
RUN bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"

# Copy the requirements.txt file and install Python packages
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt

# Copy the rest of your application into the container
COPY . .

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
but this is railways error: ERROR: failed to solve: process "/bin/sh -c pip3 install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1
182 Replies
Percy
Percy10mo ago
Project ID: 33299ddc-4953-43ff-a20d-cc4da4713125
loyahdev
loyahdevOP10mo ago
33299ddc-4953-43ff-a20d-cc4da4713125
loyahdev
loyahdevOP10mo ago
i tried doing what it said here but i got the same type of error:
To install Python packages system-wide, try apt install #12 0.740 python3-xyz, where xyz is the package you are trying to #12 0.740 install.
@Brody any updates? sorry if im rushing
Brody
Brody10mo ago
currently working on another users help thread, will circle back to this when thats done! just needed to get the build logs out of the way
loyahdev
loyahdevOP10mo ago
no worries thanks for the reply i dont have much time today but ill reply tomorrow i saw one of your old threads on this topic so im trying the nixpacks.toml method dang your fast skully
Brody
Brody10mo ago
i can click an emoji but i dont quite have the time to dig into this right now, sorry
loyahdev
loyahdevOP10mo ago
oh no worries it worked i think
Brody
Brody10mo ago
oh yeah?
loyahdev
loyahdevOP10mo ago
well it deployed im testing the api
Brody
Brody10mo ago
lets see the nixpacks.toml file
loyahdev
loyahdevOP10mo ago
https://www.answeroverflow.com/m/1139695424924557433 [phases.setup] nixPkgs = ["...", "python3"]
How to install python3 on railway server for Node.js project - Railway
I'm running a python script in my node js API and it works locally but i don't think python3 is installed on my railway server and i'm getting errors, how do i fix this?
loyahdev
loyahdevOP10mo ago
i just got the error that the package lief is not found i just gotta install it which ill search up shortly
Brody
Brody10mo ago
system package? python package?
loyahdev
loyahdevOP10mo ago
python package
Brody
Brody10mo ago
missing from your req.txt?
loyahdev
loyahdevOP10mo ago
i have it there i just dont know how to actually get the project to install from it
Brody
Brody10mo ago
[phases.setup]
nixPkgs = ["...", "python3"]

[phases.python_install]
dependsOn = ['setup']
cmds = ['pip install -r requirements.txt']
[phases.setup]
nixPkgs = ["...", "python3"]

[phases.python_install]
dependsOn = ['setup']
cmds = ['pip install -r requirements.txt']
loyahdev
loyahdevOP10mo ago
It doesn’t seem like it’s getting detected in my project
Brody
Brody10mo ago
send the build logs please
loyahdev
loyahdevOP10mo ago
I added it to the railway config in settings to but nothing Alright one second
Brody
Brody10mo ago
thems the deploy logs
Brody
Brody10mo ago
still the deploy logs build logs please
loyahdev
loyahdevOP10mo ago
Oh woops sorry Alright
Brody
Brody10mo ago
oh youre still using the dockerfile
loyahdev
loyahdevOP10mo ago
Yup
Brody
Brody10mo ago
you dont want to use nixpacks?
loyahdev
loyahdevOP10mo ago
I could I just didn’t think of it If I need to switch over I can
Brody
Brody10mo ago
you started looking into nixpacks, did you pivot back to the dockerfile?
loyahdev
loyahdevOP10mo ago
Nope I just didn’t know I couldn’t have two I was a little confused but I’m starting to get the idea now
Brody
Brody10mo ago
yeah they are multiply exclusive, needs to be one or the other
loyahdev
loyahdevOP10mo ago
Oh okay I’ll just post my dockerfile here for now
# Use an official Node runtime as a parent image
FROM node:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install Node.js dependencies
RUN npm install

# Run the install-pyzule.sh script
RUN bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"

# Copy the rest of your application into the container
COPY . .

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
# Use an official Node runtime as a parent image
FROM node:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install Node.js dependencies
RUN npm install

# Run the install-pyzule.sh script
RUN bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"

# Copy the rest of your application into the container
COPY . .

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
Brody
Brody10mo ago
wrap that in triple backticks please
loyahdev
loyahdevOP10mo ago
ah mobile sucks Yeah I will one sec Fixed Should I replicate that dockerfile in a nixpacks file?
Brody
Brody10mo ago
not yet but that script uses sudo, so its not really fit to be run in a docker environment
loyahdev
loyahdevOP10mo ago
true yeah So what should I do at this point now?
Brody
Brody10mo ago
what is pyzule?
loyahdev
loyahdevOP10mo ago
It’s a python project on GitHub to inject tweaks into iOS application files
loyahdev
loyahdevOP10mo ago
GitHub
GitHub - asdfzxcvbn/pyzule: an azule "clone" written in python3
an azule "clone" written in python3. Contribute to asdfzxcvbn/pyzule development by creating an account on GitHub.
loyahdev
loyahdevOP10mo ago
⬆️
Brody
Brody10mo ago
you would need a way to install that in a docker environment, likely simply removing sudo will do
loyahdev
loyahdevOP10mo ago
I already have all the project files in the GitHub for it Like it works locally I just gotta install the python packages to use it But yeah ill use nixpacks because a dockerfile sucks I can’t get it to work
Brody
Brody10mo ago
sounds good!!
loyahdev
loyahdevOP10mo ago
I’m using nixpacks now but: ERROR: failed to solve: process "/bin/bash -ol pipefail -c pip install -r requirements.txt" did not complete successfully: exit code: 127
Brody
Brody10mo ago
build logs please
loyahdev
loyahdevOP10mo ago
Sure It might be the file path though one sec
loyahdev
loyahdevOP10mo ago
heres the nixpacks file:
[phases.setup]
nixPkgs = ['nodejs', 'python3', 'git']
aptPkgs = ['build-essential']

[phases.install]
cmds = ['npm install', 'chmod +x ./pyzule/install-pyzule.sh', 'pip install -r requirements.txt', './pyzule/install-pyzule.sh']

[phases.build]
cmds = ['chmod +x ./pyzule/pyzule.py']

[start]
cmd = 'node index.js'
[phases.setup]
nixPkgs = ['nodejs', 'python3', 'git']
aptPkgs = ['build-essential']

[phases.install]
cmds = ['npm install', 'chmod +x ./pyzule/install-pyzule.sh', 'pip install -r requirements.txt', './pyzule/install-pyzule.sh']

[phases.build]
cmds = ['chmod +x ./pyzule/pyzule.py']

[start]
cmd = 'node index.js'
Brody
Brody10mo ago
you dont want to specify nodejs, replace that with ...
loyahdev
loyahdevOP10mo ago
alright
Brody
Brody10mo ago
add python311Packages.pip to the nixPkgs array
loyahdev
loyahdevOP10mo ago
Alright
Brody
Brody10mo ago
have you tried researching error: externally-managed-environment?
loyahdev
loyahdevOP10mo ago
I haven’t but I definitely will now I’d have to use a venv wouldn’t I?
Brody
Brody10mo ago
that sounds like something that could work
loyahdev
loyahdevOP10mo ago
I’ll try I got it to get to a better point
Brody
Brody10mo ago
awesome!
loyahdev
loyahdevOP10mo ago
I still get this error: ERROR: failed to solve: process "/bin/bash -ol pipefail -c pip install -r requirements.txt" did not complete successfully: exit code: 127 But when running an ls command 11 0.283 index.js #11 0.283 nixpacks.toml #11 0.283 package-lock.json #11 0.283 package.json #11 0.283 pyzule #11 0.283 requirements.txt #11 DONE 0.3s
Brody
Brody10mo ago
that's just a message telling you there was an error, that alone doesn't do either me or you any good, we'd need to look at the full logs
Brody
Brody10mo ago
nixpacks toml please
loyahdev
loyahdevOP10mo ago
[phases.setup] nixPkgs = ['nodejs', 'python3', 'git'] aptPkgs = ['build-essential', 'python3-venv'] [phases.install] cmds = ['ls', 'python3 -m venv /opt/venv', 'source /opt/venv/bin/activate', 'npm install', 'chmod +x ./pyzule/install-pyzule.sh', 'pip install -r requirements.txt', './pyzule/install-pyzule.sh'] [phases.build] cmds = ['chmod +x ./pyzule/pyzule.py'] [start] cmd = 'source /opt/venv/bin/activate && node index.js' I’m on mobile so I can’t tick it
Brody
Brody10mo ago
^
loyahdev
loyahdevOP10mo ago
Woops I forgot
Brody
Brody10mo ago
^
loyahdev
loyahdevOP10mo ago
Gpt removed that stuff sorry one sec
Brody
Brody10mo ago
gpt 😐
loyahdev
loyahdevOP10mo ago
sorry lmao I’m still learning I am searching online though
Brody
Brody10mo ago
gpt doesn't know anything about a nixpacks.toml file though, using it is doing more harm than good tbh
loyahdev
loyahdevOP10mo ago
I’m using gpt 4 so it has browsing to search it up but yeah
Brody
Brody10mo ago
none of what we are doing is really documented anywhere it's guessing
loyahdev
loyahdevOP10mo ago
True
Brody
Brody10mo ago
but this kind of stuff not being documented is not ideal either
loyahdev
loyahdevOP10mo ago
Yup Ill have to reply tomorrow since I gotta sleep but thank you so much for your help I would have been dead without your help here
Brody
Brody10mo ago
happy to help where I can
loyahdev
loyahdevOP10mo ago
I’ll just say now the error for requirements.txt is saying error code 1 instead of 178 but I’ll send logs tomorrow
Brody
Brody10mo ago
haha I think 1 is better than 178
loyahdev
loyahdevOP10mo ago
lol yeah but it’s still an annoying error none the less. but does that mean it’s finding the file at least?
Brody
Brody10mo ago
no clue, like I said, it's just the message telling us that there was an error during build, for the actual error you'd need to look into the logs
loyahdev
loyahdevOP10mo ago
Got it
loyahdev
loyahdevOP10mo ago
heres a new one with pip3
Brody
Brody10mo ago
well I think it's time to go back to a Dockerfile! nix is being difficult
loyahdev
loyahdevOP10mo ago
lmao alright. What should I do to my dockerfile from above to make it work? also if you reply please ping me
Brody
Brody10mo ago
start from a base alpine image, and install python, pip, node, and npm via apk
loyahdev
loyahdevOP10mo ago
How do I start as that on railway?
Brody
Brody10mo ago
sorry im not sure i understand the question
loyahdev
loyahdevOP10mo ago
Like railway will automatically install npm because it’s a JavaScript project how can I make it start with nothing And do it all manually just as you said
Brody
Brody10mo ago
install python, pip, node, and npm via apk
loyahdev
loyahdevOP10mo ago
Alright ok im gonna test a new one rk i cannot get anything to work ill send a log and what i have for dockerfile
loyahdev
loyahdevOP10mo ago
# Use Alpine Linux as the base image
FROM alpine:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, cmake, and build dependencies
RUN apk update && \
apk add --no-cache python3 py3-pip nodejs npm git bash cmake build-base python3-dev && \
python3 -m ensurepip && \
rm -rf /var/cache/apk/*

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application into the container
COPY . .

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Install pyzule
RUN bash ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
# Use Alpine Linux as the base image
FROM alpine:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, cmake, and build dependencies
RUN apk update && \
apk add --no-cache python3 py3-pip nodejs npm git bash cmake build-base python3-dev && \
python3 -m ensurepip && \
rm -rf /var/cache/apk/*

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application into the container
COPY . .

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Install pyzule
RUN bash ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
loyahdev
loyahdevOP10mo ago
ive been using a mix of gpt and searching online but havent got really anywhere
Brody
Brody10mo ago
first question, doesnt install-pyzule.sh use sudo?
loyahdev
loyahdevOP10mo ago
i would suppose so yes..
Brody
Brody10mo ago
thats still not going to work
loyahdev
loyahdevOP10mo ago
oh?
Brody
Brody10mo ago
not that its your current issue, but sudo is not to be used in a docker environment
loyahdev
loyahdevOP10mo ago
oh so what should i be doing? well first lets just atleast get the requirements.txt to install
Brody
Brody10mo ago
just not using sudo, the script is already ran as root
loyahdev
loyahdevOP10mo ago
oohh ok one sec fixed
Brody
Brody10mo ago
but yes, looking at logs now
loyahdev
loyahdevOP10mo ago
thumbsup
Brody
Brody10mo ago
remove the venv stuff, not sure why nixpacks uses it, but I don't think you have to
loyahdev
loyahdevOP10mo ago
got it
# Use Alpine Linux as the base image
FROM alpine:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, and build tools
RUN apk update && \
apk add python3 py3-pip nodejs npm git bash cmake build-base

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of your application into the container
COPY . .

RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Install pyzule
RUN ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
# Use Alpine Linux as the base image
FROM alpine:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, and build tools
RUN apk update && \
apk add python3 py3-pip nodejs npm git bash cmake build-base

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of your application into the container
COPY . .

RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py

# Install pyzule
RUN ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
loyahdev
loyahdevOP10mo ago
latest error for the code above
Brody
Brody10mo ago
This environment is externally managed bruh pip, i assure you, its not
loyahdev
loyahdevOP10mo ago
bigsob is so stupid lol
Brody
Brody10mo ago
alright put the venv stuff back
loyahdev
loyahdevOP10mo ago
alright testing ok so its detecting my packages and installing them from requirements.txt which is nice
Brody
Brody10mo ago
maybe replace cmake with make?
loyahdev
loyahdevOP10mo ago
got it
loyahdev
loyahdevOP10mo ago
# Use Alpine Linux as the base image
FROM alpine:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, and build tools
RUN apk update && \
apk add python3 py3-pip nodejs npm git bash make build-base

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of your application into the container
COPY . .

RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script
# RUN chmod +x ./pyzule/pyzule.py

# Install pyzule
RUN ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
# Use Alpine Linux as the base image
FROM alpine:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, and build tools
RUN apk update && \
apk add python3 py3-pip nodejs npm git bash make build-base

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of your application into the container
COPY . .

RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script
# RUN chmod +x ./pyzule/pyzule.py

# Install pyzule
RUN ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
loyahdev
loyahdevOP10mo ago
i must have to use cmake:
RuntimeError: CMake must be installed to build the following extensions: lief 5.320 [end of output]
Brody
Brody10mo ago
then install both cmake and make
loyahdev
loyahdevOP10mo ago
got it
Brody
Brody10mo ago
i assume you need lief?
loyahdev
loyahdevOP10mo ago
but the requirements.txt installs it
Brody
Brody10mo ago
do you need it or is it a 3rd party module?
loyahdev
loyahdevOP10mo ago
3rd party module
Brody
Brody10mo ago
do you need the module that installs it?
loyahdev
loyahdevOP10mo ago
maybe let me try without running the sh file and just installing lief directly
Brody
Brody10mo ago
can you check?
loyahdev
loyahdevOP10mo ago
i didnt make pyzule skully have no idea
loyahdev
loyahdevOP10mo ago
the problem was when i was running pyzule it said this
No description
Brody
Brody10mo ago
fair enough
loyahdev
loyahdevOP10mo ago
wait: on debian-based systems (like ubuntu), run the following:
sudo apt update ; sudo apt install unzip curl python3 python3-venv
sudo apt update ; sudo apt install unzip curl python3 python3-venv
on arch based systems, use:
sudo pacman -Syu unzip curl python
sudo pacman -Syu unzip curl python
install pyzule:
bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"
bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"
could I do that? its pyzules documentation
Brody
Brody10mo ago
you arent on a debian-based docker image, you're using alpine right now
loyahdev
loyahdevOP10mo ago
im saying for railway i was testing pyzule locally on a mac
Brody
Brody10mo ago
you are using an alpine image in your dockerfile
loyahdev
loyahdevOP10mo ago
so i would run the arch instructions correct
Brody
Brody10mo ago
you cant run apt commands on alpine, alpine uses apk try adding python3-dev to the apk packages
loyahdev
loyahdevOP10mo ago
@Brody i think i know what the problem is now. in the log theres spots saying command not found and this script tries to install lief but i think i have to modify it to work: https://pastebin.com/U5JadkgN
Pastebin
#!/bin/bashOS=$(uname)ARCH=$(uname -m)PZ_DIR=${HOME}/.config/pyzule...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
loyahdev
loyahdevOP10mo ago
specifically this line here:
${PZ_DIR}/venv/bin/pip install -U Pillow lief &> /dev/null
${PZ_DIR}/venv/bin/pip install -U Pillow lief &> /dev/null
and other packages like unzip
Brody
Brody10mo ago
did you skip installing modules from the requirements.txt file?
loyahdev
loyahdevOP10mo ago
i removed that now that i see the sh install is suppose to do it
Brody
Brody10mo ago
you got one strange app
loyahdev
loyahdevOP10mo ago
lmao yup...
Brody
Brody10mo ago
still cant use sudo though
loyahdev
loyahdevOP10mo ago
yeah
Brody
Brody10mo ago
just simply remove the word sudo the script is already ran as root, the whole build context is
loyahdev
loyahdevOP10mo ago
aight building
Brody
Brody10mo ago
add curl to the apk install list and unzip too
loyahdev
loyahdevOP10mo ago
Yup those fixed the command not found errors now it’s just the lief error I’m gonna try manual installing now that the other errors are fixed Sadly is didn’t work But I’ll send the life Logs*
Brody
Brody10mo ago
i have no clue what to make of that error time to try a debian image in your dockerfile instead
loyahdev
loyahdevOP10mo ago
Alright, here’s the main broken log parts
No description
No description
loyahdev
loyahdevOP10mo ago
What should I do to switch to Debian Atleast then we can install based on the documentation steps
Brody
Brody10mo ago
rewrite your dockerfile but use a debian image instead of alpine
loyahdev
loyahdevOP10mo ago
ok Should I add back sudo?
Brody
Brody10mo ago
nope
loyahdev
loyahdevOP10mo ago
Ok Well Leif installed! It’s just deploying now
Brody
Brody10mo ago
that was a fast rewrite
loyahdev
loyahdevOP10mo ago
I used gpt :skully: But searched a few things to Now I need a PIL module Time to install that It takes almost 4 minutes to build and deploy with Debian now Which kinda sucks but is meh
Brody
Brody10mo ago
well you are installing a lot of stuff
loyahdev
loyahdevOP10mo ago
true I’m getting this error for pil now: 3.656 ERROR: Could not find a version that satisfies the requirement PIL (from versions: none) 3.656 ERROR: No matching distribution found for PIL ----- Should I do a specific version?
Brody
Brody10mo ago
prob doesnt like the python version you have installed
loyahdev
loyahdevOP10mo ago
Oh wait Most likely yeah What python version should I install you think Because right now it’s just installing latest
Brody
Brody10mo ago
whatever version PIL supports
loyahdev
loyahdevOP10mo ago
I’m finding things online about pillow which is a form of it since I can’t find anything about pil I’ll try installing that Then try version changing Ok it built Time to test I’m getting somewhere there’s no package errors Just my code errors CMON PLEASE WORK
Brody
Brody10mo ago
so close
loyahdev
loyahdevOP10mo ago
It’s deploying now with updated code Almost It’s active now I just gotta wait for it to respond online IT WORKED LETS GOOO
Brody
Brody10mo ago
yoooo lets see the dockerfile
loyahdev
loyahdevOP10mo ago
THANK YOU SO MUCH aight one sec lmao
# Use Debian as the base image
FROM debian:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, make, cmake, build tools, curl, and unzip
# Note: Debian requires an update and also specifying python3-venv for the venv module
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv nodejs npm git bash make cmake build-essential python3-dev curl unzip

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of your application into the container
COPY . .

# Install LIEF via pip3. Might need to adjust depending on specific needs
RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py
RUN chmod +x ./pyzule/install-pyzule.sh

# Install pyzule
RUN ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
# Use Debian as the base image
FROM debian:latest

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, make, cmake, build tools, curl, and unzip
# Note: Debian requires an update and also specifying python3-venv for the venv module
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv nodejs npm git bash make cmake build-essential python3-dev curl unzip

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm install

# Copy the rest of your application into the container
COPY . .

# Install LIEF via pip3. Might need to adjust depending on specific needs
RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script
RUN chmod +x ./pyzule/pyzule.py
RUN chmod +x ./pyzule/install-pyzule.sh

# Install pyzule
RUN ./pyzule/install-pyzule.sh

# Expose port 3000
EXPOSE 3000

# Command to run the app
CMD ["node", "index.js"]
Brody
Brody10mo ago
tiny improvements
# Use Debian as the base image
FROM debian:latest

ENV NODE_ENV=production
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false
ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, make, cmake, build tools, curl, and unzip
# Note: Debian requires an update and also specifying python3-venv for the venv module
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv nodejs npm git bash make cmake build-essential python3-dev curl unzip

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm ci

# Copy the rest of your application into the container
COPY . ./

# Install LIEF via pip3. Might need to adjust depending on specific needs
RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script and Install pyzule
RUN chmod +x ./pyzule/pyzule.py && \
chmod +x ./pyzule/install-pyzule.sh && \
./pyzule/install-pyzule.sh

# Command to run the app
CMD ["node", "index.js"]
# Use Debian as the base image
FROM debian:latest

ENV NODE_ENV=production
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false
ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python, pip, Node.js, npm, git, bash, make, cmake, build tools, curl, and unzip
# Note: Debian requires an update and also specifying python3-venv for the venv module
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv nodejs npm git bash make cmake build-essential python3-dev curl unzip

# Set up a Python virtual environment and activate it
RUN python3 -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

# Install Python and Node.js dependencies
COPY package*.json ./
RUN npm ci

# Copy the rest of your application into the container
COPY . ./

# Install LIEF via pip3. Might need to adjust depending on specific needs
RUN pip3 install -r requirements.txt

# Give execution rights to the pyzule script and Install pyzule
RUN chmod +x ./pyzule/pyzule.py && \
chmod +x ./pyzule/install-pyzule.sh && \
./pyzule/install-pyzule.sh

# Command to run the app
CMD ["node", "index.js"]
loyahdev
loyahdevOP10mo ago
I just want to say one more time thank you for everything and wasting your time to help me with a very very odd project. It’s also crazy that unzipping a 100mb file and storing it only took 11mb of ram
Brody
Brody10mo ago
no time spent in #help is time wasted
loyahdev
loyahdevOP10mo ago
lol well this was longer than usually but thank you. Does this stay here because I will definitely need this later on? I used it before but it was for a simpler thing I think I remembered you helped before a few months back
Brody
Brody10mo ago
yeah this stays here
loyahdev
loyahdevOP10mo ago
Last thing does anything break if I accidentally have sudo in a command or will it work as normal
Brody
Brody10mo ago
sudo does not work in a docker environment if you need to run this script locally, run the entire script with sudo
loyahdev
loyahdevOP10mo ago
:thumbsup: @Brody I feel like my project will get very expensive just with whats its doing. do you any places where I could either get it for extremely cheap or buy a deticated server?
Brody
Brody10mo ago
sorry i only shill railway
loyahdev
loyahdevOP10mo ago
okay
Want results from more Discord servers?
Add your server