-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from mobidata-bw/ubuntu-build-image
use ubuntu image for prod build
- Loading branch information
Showing
2 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,36 @@ | ||
FROM python:3.11-alpine | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
WORKDIR /app | ||
|
||
COPY ./requirements.txt /app/requirements.txt | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . /app | ||
|
||
EXPOSE 5000 | ||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"] | ||
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 | ||
|
||
RUN apt-get install -y python3-pip | ||
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/ | ||
|
||
|
||
# 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 /app/requirements.txt | ||
RUN pip install -r /app/requirements.txt | ||
|
||
COPY . /app | ||
|
||
EXPOSE 5000 | ||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ types-requests~=2.31.0.10 | |
requests-mock~=1.11.0 | ||
mypy-gitlab-code-quality~=1.0.0 | ||
ruff~=0.1.0 | ||
|