my app do not deploy now, because the image is more heavy but my app is only 1,17 mbs
giorgio83
FREEOP

8 months ago

my app do not deploy now, because the image is more heavy but my app is only 1,17 mbs, y tryed with nixpack and railpack and do not works

Solved$10 Bounty

Pinned Solution

samgordon
PRO

8 months ago

Alright. Can you try adding this to a new file named Dockerfile in the main project directory?

FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
ADD https://astral.sh/uv/install.sh /uv-installer.sh

RUN sh /uv-installer.sh && rm /uv-installer.sh

ENV PATH="/root/.local/bin/:$PATH"

WORKDIR /app

COPY pyproject.toml /app/
COPY . /app/

RUN uv sync --locked

EXPOSE 8000

CMD ["uv", "run", "main.py"]

This works for me!

Here's my fork with the changes, feel free to take a look at the change: https://github.com/Loudbooks/driveinstagramsync/

19 Replies

samgordon
PRO

8 months ago

Please screenshot the error and send a link to your image.


giorgio83
FREEOP

8 months ago

this is the last build

Attachments


giorgio83
FREEOP

8 months ago

in nixpacks says to me, the image was 7GB, and i do not know why... and then i tryed with railpack and the result is in the picture


samgordon
PRO

8 months ago

Can you share the repository? I suspect you've committed all your build files.


giorgio83
FREEOP

8 months ago


giorgio83
FREEOP

8 months ago

now, i tryed another time, but i have the same result

Attachments


giorgio83

https://github.com/giorgio83/driveinstagramsynci think this is not possible

samgordon
PRO

8 months ago

Unfortunately this is private so I cannot access it.


giorgio83
FREEOP

8 months ago

sorry, i can make it public


giorgio83
FREEOP

8 months ago

now is public


samgordon
PRO

8 months ago

Thanks, I'll look into getting this running myself and I'll report back to you.


samgordon
PRO

8 months ago

Alright. Can you try adding this to a new file named Dockerfile in the main project directory?

FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
ADD https://astral.sh/uv/install.sh /uv-installer.sh

RUN sh /uv-installer.sh && rm /uv-installer.sh

ENV PATH="/root/.local/bin/:$PATH"

WORKDIR /app

COPY pyproject.toml /app/
COPY . /app/

RUN uv sync --locked

EXPOSE 8000

CMD ["uv", "run", "main.py"]

This works for me!

Here's my fork with the changes, feel free to take a look at the change: https://github.com/Loudbooks/driveinstagramsync/


giorgio83
FREEOP

8 months ago

ok, i try it


giorgio83

ok, i try it

samgordon
PRO

8 months ago

Let me know how it goes!


giorgio83
FREEOP

8 months ago

i do not understand...

Attachments


giorgio83
FREEOP

8 months ago

with this dockerfile

FROM python:3.10-slim

# Evitar errores interactivos
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /app

COPY requirements.txt .

# Instala dependencias del sistema necesarias
RUN apt-get update && apt-get install -y gcc g++ build-essential \
    && pip install --upgrade pip \
    && pip install --no-cache-dir -r requirements.txt \
    && apt-get remove -y gcc g++ build-essential \
    && apt-get autoremove -y \
    && apt-get clean

COPY . .

CMD ["python", "app.py"]

1topby
HOBBY

8 months ago

It seems, you are trying to deploy a small app (1.17 MB), but Railway is failing the deployment because the Docker image size is too large for the free plan. The logs show the build process is using Nixpacks and Railpack, resulting in a much larger image than your actual app size. The error message specifically says:

"Image in CTR 6.7.0: estimated limit of 4.0 GB. Upgrade your plan to Shipyard for bigger size limit." 


giorgio83

with this dockerfileFROM python:3.10-slim # Evitar errores interactivos ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 WORKDIR /app COPY requirements.txt . # Instala dependencias del sistema necesarias RUN apt-get update && apt-get install -y gcc g++ build-essential \ && pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt \ && apt-get remove -y gcc g++ build-essential \ && apt-get autoremove -y \ && apt-get clean COPY . . CMD ["python", "app.py"]

samgordon
PRO

8 months ago

This is NOT the Dockerfile I shared with you. Why did you change it?

Please use the one I sent.


Status changed to Open chandrika 8 months ago


giorgio83
FREEOP

8 months ago

because are failing , File "/app/app.py", line 4, in <module>

Jun 09 10:58:22

from flask import Flask, render_template, request, flash, redirect, url_for, jsonify, session

Jun 09 10:58:22

ModuleNotFoundError: No module named 'flask'

Jun 09 10:58:23

Traceback (most recent call last):

Jun 09 10:58:23

File "/app/main.py", line 1, in <module>

Jun 09 10:58:23

from app import app, db, start_scheduler

Jun 09 10:58:23

File "/app/app.py", line 4, in <module>

Jun 09 10:58:23

from flask import Flask, render_template, request, flash, redirect, url_for, jsonify, session

Jun 09 10:58:23

ModuleNotFoundError: No module named 'flask'

Jun 09 10:58:24

Traceback (most recent call last):

Jun 09 10:58:24

File "/app/main.py", line 1, in <module>

Jun 09 10:58:24

from app import app, db, start_scheduler

Jun 09 10:58:24

File "/app/app.py", line 4, in <module>

Jun 09 10:58:24

from flask import Flask, render_template, request, flash, redirect, url_for, jsonify, session

Jun 09 10:58:24

ModuleNotFoundError: No module named 'flask'


giorgio83
FREEOP

8 months ago

now is working with a little modification:

FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
ADD https://astral.sh/uv/install.sh /uv-installer.sh

RUN sh /uv-installer.sh && rm /uv-installer.sh

ENV PATH="/root/.local/bin/:$PATH"

WORKDIR /app

COPY pyproject.toml /app/
COPY . /app/

RUN uv pip install . --system

EXPOSE 8000

CMD ["uv", "run", "main.py"]

Thanks

Status changed to Solved chandrika 8 months ago


Loading...