-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
=
committed
Jul 5, 2024
1 parent
6cbefbc
commit 825d29e
Showing
229 changed files
with
681 additions
and
43,687 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,4 +1,5 @@ | ||
*.pyc | ||
.env | ||
db.sqlite3 | ||
set_env.sh | ||
fishauctions/customsettings.py | ||
|
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
########### | ||
# BUILDER # | ||
########### | ||
|
||
# pull official base image | ||
FROM python:3.11.4-slim-buster as builder | ||
|
||
# set work directory | ||
WORKDIR /usr/src/app | ||
|
||
# set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
pkg-config \ | ||
default-libmysqlclient-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install --upgrade pip pip-tools | ||
COPY . /usr/src/app/ | ||
|
||
# generate an updated requirements.txt file with the latest versions of all packages | ||
#RUN pip-compile requirements.in --upgrade # fixme | ||
|
||
# install python dependencies | ||
# COPY ./requirements.txt . # no need to copy this, we just generated it | ||
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt | ||
|
||
|
||
######### | ||
# FINAL # | ||
######### | ||
|
||
# pull official base image | ||
FROM python:3.11.4-slim-buster | ||
|
||
# create directory for the app user | ||
RUN mkdir -p /home/app | ||
|
||
# create the app user | ||
RUN addgroup --system app && adduser --system --group app | ||
|
||
# create the appropriate directories | ||
ENV APP_HOME=/home/app/web | ||
RUN mkdir /home/user | ||
RUN mkdir $APP_HOME | ||
RUN mkdir $APP_HOME/staticfiles | ||
RUN mkdir $APP_HOME/media | ||
|
||
WORKDIR $APP_HOME | ||
|
||
# install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
netcat \ | ||
build-essential \ | ||
pkg-config \ | ||
default-libmysqlclient-dev \ | ||
cron && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# cron setup | ||
COPY crontab /etc/cron.d/django-cron | ||
RUN chmod 0644 /etc/cron.d/django-cron | ||
RUN crontab /etc/cron.d/django-cron | ||
RUN touch /var/log/cron.log | ||
|
||
COPY --from=builder /usr/src/app/wheels /wheels | ||
COPY --from=builder /usr/src/app/requirements.txt . | ||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache /wheels/* | ||
RUN pip install mysql-connector-python | ||
|
||
COPY . $APP_HOME | ||
|
||
# chown all the files to the app user | ||
RUN chown -R app:app $APP_HOME | ||
RUN chown -R app:app /home/user | ||
RUN chown -R app:app /var/log/ | ||
USER app | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT ["sh", "./entrypoint.sh"] |
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 was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
auctions/migrations/0136_alter_lot_banned_alter_lot_partial_refund_percent.py
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 5.0.6 on 2024-06-29 22:53 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('auctions', '0135_lot_partial_refund_percent'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='lot', | ||
name='banned', | ||
field=models.BooleanField(blank=True, default=False, help_text="This lot will be hidden from views, and users won't be able to bid on it. Removed lots are not charged in invoices.", verbose_name='Removed'), | ||
), | ||
migrations.AlterField( | ||
model_name='lot', | ||
name='partial_refund_percent', | ||
field=models.IntegerField(blank=True, default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)]), | ||
), | ||
] |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.