Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
update to Ubuntu
  • Loading branch information
parklize committed Jul 22, 2024
1 parent a56f96c commit c5da910
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 13 deletions.
43 changes: 32 additions & 11 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,48 @@
FROM python:3.10-alpine
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
#
# Python3.10 install for Ubuntu
#
# ref: https://linuxize.com/post/how-to-install-python-3-8-on-ubuntu-18-04/
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get install -y python3.10 python3-pip

# Create a symlink for python3
RUN ln -sf /usr/bin/python3 /usr/bin/python
RUN ln -sf /usr/bin/pip3 /usr/bin/pip

# Verify Python installation
RUN python3 --version && python --version

COPY requirements.txt /usr/src/app/

RUN apk update && \
apk add --no-cache \
# Update package lists and install packages
RUN apt-get update && \
apt-get install -y \
gcc \
g++ \
musl-dev \
gfortran \
libffi-dev \
openblas-dev \
libopenblas-dev \
bash \
cmake \
meson \
ninja
ninja-build && \
# Clean up to reduce image size
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/

# Upgrade pythran and gast
RUN pip install --no-cache-dir --upgrade pythran gast pip
RUN pip install --no-cache-dir --upgrade pythran gast

RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt --ignore-installed

COPY . /usr/src/app

Expand Down
32 changes: 32 additions & 0 deletions server/_Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM python:3.10-alpine

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/

RUN apk update && \
apk add --no-cache \
gcc \
g++ \
musl-dev \
gfortran \
libffi-dev \
openblas-dev \
bash \
cmake \
meson \
ninja

# Upgrade pythran and gast
RUN pip install --no-cache-dir --upgrade pythran gast pip

RUN pip3 install --no-cache-dir -r requirements.txt

COPY . /usr/src/app

EXPOSE 8080

ENTRYPOINT ["python3"]

CMD ["-m", "openapi_server"]
4 changes: 2 additions & 2 deletions server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ connexion[swagger-ui,flask] >= 2.6.0; python_version>="3.6"
# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug
# we must peg werkzeug versions below to fix connexion
# https://github.com/zalando/connexion/pull/1044
gast==0.2.2
#gast==0.2.2
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
setuptools >= 21.0.0
SPARQLWrapper == 2.0.0
#SPARQLWrapper == 2.0.0
blinker==1.6.3
click==8.1.7
contourpy==1.1.1
Expand Down

0 comments on commit c5da910

Please sign in to comment.