Skip to content

Commit

Permalink
Merge pull request #129 from smswithoutborders/staging
Browse files Browse the repository at this point in the history
build: Upgrade Python version to 3.12.3 and optimize Dockerfile.
  • Loading branch information
PromiseFru authored Sep 18, 2024
2 parents 2836c8a + ae38fe9 commit ee6bfad
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
FROM python:3.9 as base
FROM python:3.12.3-slim AS base

RUN apt-get update && \
apt-get install -y build-essential \
apache2 apache2-dev \
apt-get install -y --no-install-recommends \
build-essential \
apache2 \
apache2-dev \
python3-dev \
default-libmysqlclient-dev \
supervisor \
libsqlcipher-dev \
libsqlite3-dev && \
libsqlite3-dev \
git \
curl && \
rm -rf /var/lib/apt/lists/*

WORKDIR /smswithoutborders-backend
WORKDIR /vault

COPY . .
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN pip install -U pip && \
pip install -U setuptools wheel && \
pip install --no-cache-dir --force-reinstall -r requirements.txt && \
RUN pip install -U --quiet --no-cache-dir pip setuptools && \
pip install --quiet --no-cache-dir --force-reinstall -r requirements.txt && \
usermod -u 1000 www-data && \
usermod -G root www-data

FROM base as development
FROM base AS development
CMD echo "[*] Starting Development server ..." && \
make dummy-user-inject && \
mod_wsgi-express start-server wsgi_script.py \
Expand All @@ -30,6 +33,6 @@ CMD echo "[*] Starting Development server ..." && \
--port '${PORT}' \
--log-to-terminal

FROM base as production
FROM base AS production
ENV MODE=production
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

0 comments on commit ee6bfad

Please sign in to comment.