refactor: imporved layer caching for dockerfile
using existing built image for account 2
This commit is contained in:
@@ -1 +1,11 @@
|
||||
.unused
|
||||
Downloads
|
||||
.venv
|
||||
volumes
|
||||
.env
|
||||
.env.*
|
||||
my_account.session
|
||||
.gitignore
|
||||
README.md
|
||||
.git
|
||||
uv.lock
|
||||
+16
-8
@@ -1,10 +1,18 @@
|
||||
FROM python:3.11
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git wget ffmpeg mediainfo && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt /app/
|
||||
|
||||
RUN python -m pip install --no-cache-dir --upgrade pip && \
|
||||
python -m pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
COPY . /app
|
||||
RUN apt-get -qq update && apt-get -qq install -y git wget ffmpeg mediainfo\
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN python -m venv --copies /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
CMD ["python", "main.py"]
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
CMD ["python", "-u", "main.py"]
|
||||
+2
-3
@@ -3,6 +3,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: userbot:latest
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
@@ -16,9 +17,7 @@ services:
|
||||
- 1.1.1.1
|
||||
|
||||
anna:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: userbot:latest
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ name = "userbot"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
"aiofiles>=25.1.0",
|
||||
"aiohttp>=3.13.2",
|
||||
|
||||
Reference in New Issue
Block a user