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
Pinned Solution
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
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
8 months ago
Can you share the repository? I suspect you've committed all your build files.
8 months ago
https://github.com/giorgio83/driveinstagramsync
i think this is not possible
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
8 months ago
Unfortunately this is private so I cannot access it.
8 months ago
sorry, i can make it public
8 months ago
now is public
8 months ago
Thanks, I'll look into getting this running myself and I'll report back to you.
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/
8 months ago
ok, i try it
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"]
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"]
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
8 months ago
because are failing , File "/app/app.py", line 4, in <module>
from flask import Flask, render_template, request, flash, redirect, url_for, jsonify, session
ModuleNotFoundError: No module named 'flask'
Traceback (most recent call last):
File "/app/main.py", line 1, in <module>
from app import app, db, start_scheduler
File "/app/app.py", line 4, in <module>
from flask import Flask, render_template, request, flash, redirect, url_for, jsonify, session
ModuleNotFoundError: No module named 'flask'
Traceback (most recent call last):
File "/app/main.py", line 1, in <module>
from app import app, db, start_scheduler
File "/app/app.py", line 4, in <module>
from flask import Flask, render_template, request, flash, redirect, url_for, jsonify, session
ModuleNotFoundError: No module named 'flask'
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"]
ThanksStatus changed to Solved chandrika • 8 months ago