Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrates the dockerfile to alpine #65

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
docker build . --file Dockerfile --tag $IMAGE_NAME --squash

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
# 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/beesite_uwsgi.ini /etc/uwsgi/uwsgi.ini

WORKDIR /app
COPY /src /app

RUN gzip --keep --best --force --recursive /app/beesite/static/ && \
chown -R www-data:www-data /app
RUN gzip -k --best --force /app/beesite/static/ \
&& adduser -u 82 -D -S -G www-data www-data \
&& chown -R www-data:www-data /app

USER www-data:www-data

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "beesite"
version = "2.0.0"
version = "2.1.0"
description = "BeeStation13 Website"
authors = ["Qwertyquerty", "Crossedfall"]
license = "APACHE"
Expand Down