Skip to content

Commit

Permalink
Migrates the dockerfile to alpine (#65)
Browse files Browse the repository at this point in the history
* Updates Docker to use alpine

* Updates the docker action to use v3

* Version bumps
  • Loading branch information
Crossedfall authored Nov 20, 2023
1 parent b2ae56e commit ac0a1fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
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

0 comments on commit ac0a1fc

Please sign in to comment.