Skip to content

Commit 4a70d6a

Browse files
committed
chore: migrate to uv
1 parent 8e5bed0 commit 4a70d6a

File tree

14 files changed

+2328
-3674
lines changed

14 files changed

+2328
-3674
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__pycache__
2+
.venv
3+
.git
4+
.env

Dockerfile

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,33 @@
1-
FROM node:22.5.1-alpine AS cssbuild
1+
FROM node:24-alpine AS cssbuild
22

33
WORKDIR /app
44

5-
COPY package.json package-lock.json ./
6-
RUN npm install
5+
COPY package.json pnpm-lock.yaml ./
6+
RUN npm install -g pnpm && \
7+
pnpm install
78

8-
COPY . .
9-
RUN npm run css-prod
10-
CMD ["npm", "run", "css-dev"]
9+
COPY bullet ./bullet
10+
COPY css ./css
11+
RUN pnpm run build
12+
CMD ["pnpm", "run", "watch"]
1113

12-
FROM python:3.12-slim-bookworm
13-
WORKDIR /app
14-
15-
ENV PYTHONDONTWRITEBYTECODE 1
16-
ENV PYTHONUNBUFFERED 1
17-
ENV DEBUG 0
14+
FROM ghcr.io/trojsten/django-docker:v6
1815

16+
USER root
1917
RUN export DEBIAN_FRONTEND=noninteractive \
2018
&& apt update \
21-
&& apt -y upgrade \
22-
&& apt -y install libmaxminddb0 gettext librsvg2-bin build-essential caddy \
19+
&& apt install -y libmaxminddb0 gettext librsvg2-bin build-essential \
2320
&& apt -y clean \
2421
&& rm -rf /var/lib/apt/lists/*
22+
USER appuser
2523

26-
ARG MULTIRUN_VERSION=1.1.3
27-
ADD https://github.com/nicolas-van/multirun/releases/download/${MULTIRUN_VERSION}/multirun-x86_64-linux-gnu-${MULTIRUN_VERSION}.tar.gz /tmp
28-
RUN tar -xf /tmp/multirun-x86_64-linux-gnu-${MULTIRUN_VERSION}.tar.gz \
29-
&& mv multirun /bin \
30-
&& rm /tmp/*
24+
COPY pyproject.toml uv.lock ./
25+
RUN uv sync --frozen
3126

32-
RUN pip install --upgrade pipenv
33-
COPY Pipfile Pipfile.lock ./
34-
RUN pipenv install --system --dev --deploy
27+
COPY --chown=appuser:appuser . .
28+
COPY --chown=appuser:appuser --from=cssbuild /app/bullet/web/static/app.css /app/bullet/web/static/
29+
WORKDIR /app/bullet
3530

36-
COPY ./bullet .
37-
COPY ./CHANGELOG.md .
38-
COPY --from=cssbuild /app/bullet/web/static/app.css ./web/static/app.css
31+
RUN SECRET_KEY=none python manage.py collectstatic --no-input
3932

40-
ENV WEB_CONCURRENCY=4
41-
RUN DATABASE_URL=sqlite://:memory: python manage.py collectstatic --no-input
42-
CMD ["/app/entrypoint.sh"]
33+
ENV BASE_START=/app/start.sh

Pipfile

Lines changed: 0 additions & 48 deletions
This file was deleted.

Pipfile.lock

Lines changed: 0 additions & 2070 deletions
This file was deleted.

docker-compose.yaml renamed to compose.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.4"
21
services:
32
db:
43
image: postgres:14-alpine
@@ -10,8 +9,6 @@ services:
109
- POSTGRES_DB=bullet
1110
volumes:
1211
- postgres_data:/var/lib/postgresql/data/
13-
ports:
14-
- "5433:5432"
1512

1613
web:
1714
build:
@@ -28,14 +25,14 @@ services:
2825
ports:
2926
- "8000:8000"
3027
volumes:
31-
- ./bullet/:/app/
28+
- ./bullet/:/app/bullet/
3229
- geiop_data:/geoip/
3330
- ./CHANGELOG.md:/app/CHANGELOG.md:ro
3431
depends_on:
3532
- db
3633
- geoip
3734
- meilisearch
38-
command: "./entrypoint.sh dev"
35+
command: "/app/start.sh dev"
3936

4037
tailwind:
4138
build:
@@ -44,8 +41,8 @@ services:
4441
volumes:
4542
- ./bullet/:/app/bullet/
4643
- ./css:/app/css/
47-
- ./tailwind.config.js:/app/tailwind.config.js
4844
- ./package.json:/app/package.json
45+
- ./pnpm-lock.yaml:/app/pnpm-lock.yaml
4946
tty: true
5047

5148
geoip:

css/app.css

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
2+
3+
@theme {
4+
--font-family-sans: ["Work Sans", "sans-serif"];
5+
6+
--aspect-ratio-4/3: 4 / 3;
7+
8+
--grid-template-columns-registration: min-content 3fr 2fr;
9+
--grid-template-columns-contestants-edit: min-content 3fr 2fr min-content;
10+
11+
--color-primary: var(--primary);
12+
--color-primary-light: var(--primary-light);
13+
--color-primary-lighter: var(--gradient-dark);
14+
--color-primary-dark: var(--primary-dark);
15+
16+
--typography-max-width: 75ch;
17+
}
418

519
.branch-math {
620
--primary: #27C349;
@@ -84,7 +98,7 @@
8498
}
8599

86100
.cb-edit {
87-
@apply bg-yellow-400 bg-opacity-50 hover:bg-opacity-100 transition-colors;
101+
@apply bg-yellow-400/50 hover:bg-yellow-400 transition-colors;
88102
}
89103

90104
.bold-primary b, .bold-primary strong {

helper.py

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)