Skip to content

Commit

Permalink
fix base docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
mguptahub committed Jun 25, 2024
1 parent ae36fe0 commit c8aa91e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 46 deletions.
28 changes: 5 additions & 23 deletions aio/Dockerfile-full-base
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM tonistiigi/binfmt AS binfmt

FROM debian:12-slim
FROM python:3.12-slim

# Set environment variables to non-interactive for apt
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -13,7 +13,8 @@ RUN apt-get update && \
gnupg2 curl ca-certificates lsb-release software-properties-common \
build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils \
tk-dev libffi-dev liblzma-dev supervisor nginx nano vim ncdu
tk-dev libffi-dev liblzma-dev supervisor nginx nano vim ncdu \
sudo lsof net-tools libpq-dev procps gettext

# Install Redis 7.2
RUN echo "deb http://deb.debian.org/debian $(lsb_release -cs)-backports main" > /etc/apt/sources.list.d/backports.list && \
Expand Down Expand Up @@ -47,23 +48,11 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs

# Install Python 3.12 from source
RUN cd /usr/src && \
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz && \
tar xzf Python-3.12.0.tgz && \
cd Python-3.12.0 && \
./configure --enable-optimizations && \
make altinstall && \
rm -f /usr/src/Python-3.12.0.tgz

RUN python3.12 -m pip install --upgrade pip

RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc
RUN python -m pip install --upgrade pip

# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/src/Python-3.12.0
rm -rf /var/lib/apt/lists/*

WORKDIR /app

Expand All @@ -75,16 +64,9 @@ RUN mkdir -p /app/{data,logs} && \
# Create Supervisor configuration file
COPY supervisord-full-base /app/supervisord.conf

RUN apt-get update && \
apt-get install -y sudo lsof net-tools libpq-dev procps gettext && \
apt-get clean

RUN sudo -u postgres /usr/lib/postgresql/$POSTGRES_VERSION/bin/initdb -D /var/lib/postgresql/data
COPY postgresql.conf /etc/postgresql/postgresql.conf

RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

# Expose ports for Redis, PostgreSQL, and MinIO
EXPOSE 6379 5432 9000 80 443

Expand Down
28 changes: 5 additions & 23 deletions aio/Dockerfile-slim-base
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM tonistiigi/binfmt AS binfmt

FROM debian:12-slim
FROM python:3.12-slim

# Set environment variables to non-interactive for apt
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -13,29 +13,18 @@ RUN apt-get update && \
gnupg2 curl ca-certificates lsb-release software-properties-common \
build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils \
tk-dev libffi-dev liblzma-dev supervisor nginx nano vim ncdu
tk-dev libffi-dev liblzma-dev supervisor nginx nano vim ncdu \
sudo lsof net-tools libpq-dev procps gettext

# Install Node.js 18
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs

# Install Python 3.12 from source
RUN cd /usr/src && \
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz && \
tar xzf Python-3.12.0.tgz && \
cd Python-3.12.0 && \
./configure --enable-optimizations && \
make altinstall && \
rm -f /usr/src/Python-3.12.0.tgz
RUN python -m pip install --upgrade pip

RUN python3.12 -m pip install --upgrade pip

RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/src/Python-3.12.0
rm -rf /var/lib/apt/lists/*

WORKDIR /app

Expand All @@ -47,13 +36,6 @@ RUN mkdir -p /app/{data,logs} && \
# Create Supervisor configuration file
COPY supervisord-slim-base /app/supervisord.conf

RUN apt-get update && \
apt-get install -y sudo lsof net-tools libpq-dev procps gettext && \
apt-get clean

RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

# Expose ports for Redis, PostgreSQL, and MinIO
EXPOSE 80 443

Expand Down

0 comments on commit c8aa91e

Please sign in to comment.