Merge pull request #15 from nicolabelluti/master

Made the Docker image significantly smaller
This commit is contained in:
Bryan
2025-01-31 12:06:13 -06:00
committed by GitHub
4 changed files with 37 additions and 19 deletions

View File

@@ -1 +1,16 @@
db.sqlite3 docker-compose.yml
# Docs
README.md
setup.md
LICENSE
# Git stuff
.git
.github
.gitignore
# .gitignore
*.pyc
.venv
db.sqlite3

View File

@@ -2,8 +2,8 @@ name: update docker image
on: on:
push: push:
branches: tags:
- "master" - 'v*.*.*'
jobs: jobs:
build: build:
@@ -23,4 +23,4 @@ jobs:
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
push: true push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/rdgen:latest tags: ${{ vars.DOCKERHUB_USERNAME }}/rdgen:latest

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM python:3.13-alpine
RUN adduser -D user
USER user
WORKDIR /opt/rdgen
COPY . .
RUN pip install --no-cache-dir -r requirements.txt \
&& python manage.py migrate
ENV PYTHONUNBUFFERED=1
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD wget --spider 0.0.0.0:8000
CMD ["/home/user/.local/bin/gunicorn", "-c", "gunicorn.conf.py", "rdgen.wsgi:application"]

View File

@@ -1,15 +0,0 @@
FROM python:3.13
WORKDIR /opt/rdgen
COPY . .
RUN python -m venv rdgen
RUN chmod +x rdgen/bin/activate
RUN /bin/sh -c rdgen/bin/activate
RUN pip install --no-cache-dir -r requirements.txt
RUN python manage.py migrate
EXPOSE 8000
CMD ["gunicorn", "-c", "gunicorn.conf.py", "rdgen.wsgi:application"]