Skip to content

Commit

Permalink
Merge pull request #4 from JooeunAhn/python3.11-dockerfile
Browse files Browse the repository at this point in the history
Switch to python 3.11.9 official Image for dockerfile
  • Loading branch information
jjh-kim authored May 27, 2024
2 parents 71eec3e + 3138a86 commit a7e9ccb
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
FROM ubuntu:20.04
FROM python:3.11.9-slim

ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED=1 \
PYTHONPATH=/opt/sbosc

# apt update
RUN apt-get update && \
apt -y upgrade && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
default-mysql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# install python
RUN apt-get install -y python3.11 python3.11-dev python3.11-distutils build-essential

# install mysql, postgres clients
RUN apt-get install -y libmysqlclient-dev mysql-client

# install utilities
RUN apt-get install -y curl

# Set working directory
WORKDIR /opt/sbosc

# Make python 3.11 the default
# Register the version in alternatives
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1

# Set python 3 as the default python
RUN update-alternatives --set python /usr/bin/python3.11

# Install pip and requirements.txt
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python

# Install requirements
# Install any needed packages specified in requirements.txt
COPY requirements.txt ./
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy repository
COPY src ./
ENV PYTHONPATH=/opt/sbosc

0 comments on commit a7e9ccb

Please sign in to comment.