Skip to content

Commit

Permalink
Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
the-infinity committed Nov 4, 2024
1 parent bdd2c5a commit 678e08e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 46 deletions.
78 changes: 34 additions & 44 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# Upgrade packages and install locales
RUN echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections && \
echo "locales locales/locales_to_be_generated select en_US.UTF-8 UTF-8" | debconf-set-selections && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y locales

ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LANGUAGE=en_US:en

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1

# Install commonly used packages
# - libssl-dev, libffi-dev: required for Python cryptography module
RUN apt-get install -y \
python3-pip \
python3-dev \
build-essential \
libssl-dev \
libffi-dev \
inotify-tools \
wait-for-it \
git \
wget

# Create symlinks /usr/bin/python and /usr/bin/pip, but only if these files don't exist yet
RUN { [ -e /usr/bin/python ] || ln -s /usr/bin/python3 /usr/bin/python; } && \
{ [ -e /usr/bin/pip ] || ln -s /usr/bin/pip3 /usr/bin/pip; }

RUN mkdir -p /app
WORKDIR /app

COPY ./requirements.txt requirements-dev.txt .
RUN pip install --upgrade pip && \
pip install -r requirements.txt -r requirements-dev.txt

CMD ["python3", "runserver.py"]
EXPOSE 5000
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

# Upgrade packages and install locales
RUN echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections && \
echo "locales locales/locales_to_be_generated select en_US.UTF-8 UTF-8" | debconf-set-selections && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y locales

ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LANGUAGE=en_US:en

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1

# Install commonly used packages
# - libssl-dev, libffi-dev: required for Python cryptography module
RUN apt-get install -y python3-pip

# Create symlinks /usr/bin/python and /usr/bin/pip, but only if these files don't exist yet
RUN { [ -e /usr/bin/python ] || ln -s /usr/bin/python3 /usr/bin/python; } && \
{ [ -e /usr/bin/pip ] || ln -s /usr/bin/pip3 /usr/bin/pip; }

RUN mkdir -p /app
WORKDIR /app

COPY ./requirements.txt requirements-dev.txt .
RUN pip install --break-system-packages -r requirements.txt -r requirements-dev.txt

CMD ["python3", "runserver.py"]
EXPOSE 5000
2 changes: 1 addition & 1 deletion Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ validataclass~=0.11.0
python-dotenv~=1.0.1
click~=8.1.7
openpyxl~=3.1.5
opening-hours-py~=0.6.18
opening-hours-py~=0.8.2
kombu~=5.4.2
lxml~=5.3.0
parkapi-sources~=0.14.1
Expand Down

0 comments on commit 678e08e

Please sign in to comment.