From 317d4b7b6f8a5d5a6b4a9a6cc8f516282d0bb515 Mon Sep 17 00:00:00 2001 From: proffapt Date: Thu, 11 Jul 2024 12:16:44 +0530 Subject: [PATCH] feat: reduce final build size --- docker-compose.yml | 16 ++++++++-------- mftp-doctor/Dockerfile | 10 +++++----- mftp/Dockerfile | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 359d9cc..edbe9f0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,13 @@ services: container_name: mftp command: $MFTP_MODE volumes: - - $MFTP_CONFIG/env.py:/mftp/env.py - - $MFTP_CONFIG/token.json:/mftp/token.json - - $MFTP_CONFIG/credentials.json:/mftp/credentials.json - - $MFTP_CONFIG/mail_send_token.json:/mftp/mail_send_token.json - - $MFTP_CONFIG/mail_send_creds.json:/mftp/mail_send_creds.json - - $MFTP_CONFIG/.lsnif:/mftp/.lsnif - - $MFTP_CONFIG/.session:/mftp/.session + - $MFTP_CONFIG/env.py:/app/env.py + - $MFTP_CONFIG/token.json:/app/token.json + - $MFTP_CONFIG/credentials.json:/app/credentials.json + - $MFTP_CONFIG/mail_send_token.json:/app/mail_send_token.json + - $MFTP_CONFIG/mail_send_creds.json:/app/mail_send_creds.json + - $MFTP_CONFIG/.lsnif:/app/.lsnif + - $MFTP_CONFIG/.session:/app/.session mftp-doctor: build: @@ -27,4 +27,4 @@ services: command: ${DOCTOR_MODE:-} volumes: - /var/run/docker.sock:/var/run/docker.sock - - $DOCTOR_CONFIG/env.py:/mftp-doctor/env.py + - $DOCTOR_CONFIG/env.py:/app/env.py diff --git a/mftp-doctor/Dockerfile b/mftp-doctor/Dockerfile index 884b051..167cc91 100644 --- a/mftp-doctor/Dockerfile +++ b/mftp-doctor/Dockerfile @@ -1,17 +1,17 @@ -# Base image of python v3.11.8 -FROM python:3.11.8 +# Base image of python v3.11.9 +FROM python:3.11.9-slim # Configure IST timezone ENV TZ="Asia/Kolkata" -# Setup the working directory as /mftp-doctor -WORKDIR /mftp-doctor +# Setup the working directory as /app +WORKDIR /app # Get requirements file into container COPY requirements.txt . # Install the rquirements -RUN pip3 install -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt # Copy mftp-doctor.py script COPY mftp-doctor.py . diff --git a/mftp/Dockerfile b/mftp/Dockerfile index 8208b73..c7a0831 100644 --- a/mftp/Dockerfile +++ b/mftp/Dockerfile @@ -1,17 +1,17 @@ -# Base image of python v3.11.8 -FROM python:3.11.8 +# Base image of python v3.11.9-slim +FROM python:3.11.9-slim # Configure IST timezone ENV TZ="Asia/Kolkata" -# Setup the working directory as /mftp -WORKDIR /mftp +# Setup the working directory as /app +WORKDIR /app # Get requirements file into container COPY requirements.txt . # Install the rquirements -RUN pip3 install -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt # Copy codebase COPY . .