Skip to content

Commit

Permalink
fix base
Browse files Browse the repository at this point in the history
  • Loading branch information
mguptahub committed Jun 27, 2024
1 parent aae6c2e commit 3302d68
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
31 changes: 13 additions & 18 deletions aio/Dockerfile-base-full
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ FROM python:3.12-slim

# Set environment variables to non-interactive for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV BUILD_TYPE=full

SHELL [ "/bin/bash", "-c" ]

WORKDIR /app

RUN mkdir -p /app/{data,logs} && \
mkdir -p /app/data/{redis,pg,minio,nginx} && \
mkdir -p /app/logs/{access,error} && \
mkdir -p /etc/supervisor/conf.d

# Update the package list and install prerequisites
RUN apt-get update && \
apt-get install -y \
Expand All @@ -31,6 +39,8 @@ RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmo
apt-get install -y postgresql-$POSTGRES_VERSION postgresql-client-$POSTGRES_VERSION && \
mkdir -p /var/lib/postgresql/data && \
chown -R postgres:postgres /var/lib/postgresql
COPY postgresql.conf /etc/postgresql/postgresql.conf
RUN sudo -u postgres /usr/lib/postgresql/$POSTGRES_VERSION/bin/initdb -D /var/lib/postgresql/data

# Install MinIO
ARG TARGETARCH
Expand All @@ -43,34 +53,19 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
fi && \
chmod +x /usr/local/bin/minio


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

RUN python -m pip install --upgrade pip

# Clean up
RUN apt-get clean && \
apt-get install -y nodejs && \
python -m pip install --upgrade pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN mkdir -p /app/{data,logs} && \
mkdir -p /app/data/{redis,pg,minio,nginx} && \
mkdir -p /app/logs/{access,error} && \
mkdir -p /etc/supervisor/conf.d

# Create Supervisor configuration file
COPY supervisord-full-base /app/supervisord.conf
COPY nginx.conf /etc/nginx/nginx.conf.template
COPY env.sh /app/nginx-start.sh
RUN chmod +x /app/nginx-start.sh

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

ENV BUILD_TYPE=full
# Expose ports for Redis, PostgreSQL, and MinIO
EXPOSE 6379 5432 9000 80 443

Expand Down
23 changes: 10 additions & 13 deletions aio/Dockerfile-base-slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ FROM python:3.12-slim

# Set environment variables to non-interactive for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV BUILD_TYPE=slim

SHELL [ "/bin/bash", "-c" ]

WORKDIR /app

RUN mkdir -p /app/{data,logs} && \
mkdir -p /app/data/{nginx} && \
mkdir -p /app/logs/{access,error} && \
mkdir -p /etc/supervisor/conf.d

# Update the package list and install prerequisites
RUN apt-get update && \
apt-get install -y \
Expand All @@ -20,27 +28,16 @@ RUN apt-get update && \
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs

RUN python -m pip install --upgrade pip

# Clean up
RUN apt-get clean && \
RUN python -m pip install --upgrade pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN mkdir -p /app/{data,logs} && \
mkdir -p /app/data/{nginx} && \
mkdir -p /app/logs/{access,error} && \
mkdir -p /etc/supervisor/conf.d

# Create Supervisor configuration file
COPY supervisord-slim-base /app/supervisord.conf
COPY nginx.conf /etc/nginx/nginx.conf.template
COPY env.sh /app/nginx-start.sh
RUN chmod +x /app/nginx-start.sh

ENV BUILD_TYPE=slim

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

Expand Down
2 changes: 1 addition & 1 deletion aio/postgresql.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

data_directory = '/var/lib/postgresql/15/main' # use data in another directory
data_directory = '/var/lib/postgresql/data' # use data in another directory
# (change requires restart)
hba_file = '/etc/postgresql/15/main/pg_hba.conf' # host-based authentication file
# (change requires restart)
Expand Down

0 comments on commit 3302d68

Please sign in to comment.