-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the DockerFile to use alpine & bumps to 2.1 (#25)
* Updates the DockerFile to use alpine * Bumps to 2.1 * Updates the Docker Login action to v3
- Loading branch information
1 parent
4ab1e0e
commit 849e10f
Showing
4 changed files
with
13 additions
and
16 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
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,40 +1,37 @@ | ||
# For more information, please refer to https://aka.ms/vscode-docker-python | ||
FROM python:3.11-slim-bullseye as base | ||
FROM python:3.11-alpine as base | ||
|
||
# Keeps Python from generating .pyc files in the container | ||
# Turns off buffering for easier container logging | ||
# Prevents poetry from creating a virtualenv | ||
ENV PYTHONFAULTHANDLER=1 \ | ||
PYTHONHASHSEED=random \ | ||
PYTHONUNBUFFERED=1 \ | ||
POETRY_VERSION=1.6.1 \ | ||
POETRY_VERSION=1.7.1 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
PYTHONDONTWRITEBYTECODE=1 | ||
|
||
COPY ["poetry.lock", "pyproject.toml", "./"] | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends default-libmysqlclient-dev gcc git && \ | ||
pip install "poetry==$POETRY_VERSION" | ||
RUN apk add --no-cache mariadb-dev \ | ||
&& apk add --no-cache --virtual build-dependencies gcc git libc-dev linux-headers \ | ||
&& pip install --no-cache-dir "poetry==$POETRY_VERSION" | ||
|
||
# Install pip requirements | ||
|
||
RUN poetry install --without=dev --no-root --no-interaction --no-ansi | ||
|
||
RUN apt-get autoremove gcc git --purge -y && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm -rf /root/.cache | ||
RUN poetry install --without=dev --no-root --no-interaction --no-ansi \ | ||
&& apk del --purge build-dependencies | ||
|
||
COPY server-conf/bapi_uwsgi.ini /etc/uwsgi/uwsgi.ini | ||
|
||
FROM base as final | ||
WORKDIR /app | ||
COPY /src /app | ||
|
||
RUN chown -R www-data:www-data /app | ||
RUN adduser -u 82 -D -S -G www-data www-data \ | ||
&& chown -R www-data:www-data /app | ||
|
||
USER www-data:www-data | ||
|
||
EXPOSE 8081 | ||
EXPOSE 8080 | ||
|
||
CMD ["/usr/local/bin/uwsgi", "--ini", "/etc/uwsgi/uwsgi.ini"] |
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
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