Skip to content

Commit a12c59b

Browse files
committed
fix: build corrections
1 parent 149cb68 commit a12c59b

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

deploy/docker/dev/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG PYTHON_BUILDER_IMAGE=3.11-slim-bookworm
33
## ---------------------------------------------------------------------------------- ##
44
## ------------------------- Python base -------------------------------------------- ##
55
## ---------------------------------------------------------------------------------- ##
6-
FROM python:${PYTHON_BUILDER_IMAGE} as python-base
6+
FROM python:${PYTHON_BUILDER_IMAGE} AS python-base
77
ENV PIP_DEFAULT_TIMEOUT=100 \
88
PIP_DISABLE_PIP_VERSION_CHECK=1 \
99
PIP_NO_CACHE_DIR=1 \
@@ -46,24 +46,27 @@ RUN apt-get install -y --no-install-recommends build-essential curl \
4646
## -------------------------- install application ----------------------------------- ##
4747
WORKDIR /workspace/app
4848
COPY pyproject.toml uv.lock README.md .pre-commit-config.yaml LICENSE Makefile \
49-
package.json package-lock.json vite.config.ts tsconfig.json tsconfig.node.json \
49+
package.json package-lock.json vite.config.ts tsconfig.json \
5050
tailwind.config.cjs postcss.config.cjs components.json \
5151
./
5252
COPY tools ./tools/
5353
COPY public ./public/
5454
COPY resources ./resources/
5555
RUN python -m venv --copies /workspace/app/.venv \
5656
&& /workspace/app/.venv/bin/pip install cython uv nodeenv \
57-
&& uv install ${UV_INSTALL_ARGS}
57+
&& uv sync ${UV_INSTALL_ARGS} \
58+
&& uvx nodeenv .venv --force --quiet \
59+
&& NODE_OPTIONS="--no-deprecation --disable-warning=ExperimentalWarning" npm install --no-fund
60+
5861
COPY src ./src/
5962

6063
## ---------------------------------------------------------------------------------- ##
6164
## -------------------------------- development build ------------------------------- ##
6265
## ---------------------------------------------------------------------------------- ##
6366
## ------------------------- use builder base --------------------------------------- ##
64-
FROM build-base as dev-image
67+
FROM build-base AS dev-image
6568
ARG ENV_SECRETS="runtime-secrets"
66-
ARG LITESTAR_APP="app.asgi:app"
69+
ARG LITESTAR_APP="app.asgi:create_app"
6770
## --------------------------- standardize execution env ----------------------------- ##
6871
ENV PATH="/workspace/app/.venv/bin:$PATH" \
6972
VIRTUAL_ENV="/workspace/app/.venv" \
@@ -82,7 +85,7 @@ WORKDIR /workspace/app
8285
COPY docs/ docs/
8386
COPY tests/ tests/
8487
COPY src src/
85-
RUN uv install $UV_INSTALL_ARGS
88+
RUN uv sync $UV_INSTALL_ARGS
8689
STOPSIGNAL SIGINT
8790
EXPOSE 8000
8891
ENTRYPOINT ["tini","--" ]

deploy/docker/run/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN make build
6767

6868
FROM python-base as run-image
6969
ARG ENV_SECRETS="runtime-secrets"
70-
ARG LITESTAR_APP="app.asgi:app"
70+
ARG LITESTAR_APP="app.asgi:create_app"
7171
ENV ENV_SECRETS="${ENV_SECRETS}" \
7272
LITESTAR_APP="${LITESTAR_APP}"
7373

deploy/docker/run/Dockerfile.distroless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ RUN /workspace/app/.venv/bin/pip install --quiet --disable-pip-version-check --n
9595
FROM ${PYTHON_RUN_IMAGE} as run-image
9696
ARG ENV_SECRETS="runtime-secrets"
9797
ARG CHIPSET_ARCH=x86_64-linux-gnu
98-
ARG LITESTAR_APP="app.asgi:app"
98+
ARG LITESTAR_APP="app.asgi:create_app"
9999
ENV PATH="/workspace/app/.venv/bin:/bin:/usr/local/bin:$PATH" \
100100
ENV_SECRETS="${ENV_SECRETS}" \
101101
CHIPSET_ARCH="${CHIPSET_ARCH}" \

docker-compose.override.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,13 @@ x-development-volumes: &development-volumes
1919
- ./.env.docker.example:/workspace/app/.env
2020

2121
services:
22-
localmail:
23-
image: mailhog/mailhog:v1.0.0
24-
container_name: localmail
25-
ports:
26-
- "8025:8025"
2722
app:
2823
build:
2924
context: .
3025
dockerfile: deploy/docker/dev/Dockerfile
3126
ports:
3227
- "8000:8000"
3328
- "3006:3006"
34-
image: app:latest-dev
3529
tty: true
3630
environment:
3731
VITE_USE_SERVER_LIFESPAN: "true" # true in dev or run
@@ -40,7 +34,9 @@ services:
4034
restart: always
4135
<<: *development-volumes
4236
worker:
43-
image: app:latest-dev
37+
build:
38+
context: .
39+
dockerfile: deploy/docker/dev/Dockerfile
4440
command: litestar workers run
4541
tty: true
4642
restart: always
@@ -54,7 +50,9 @@ services:
5450
env_file:
5551
- .env.docker.example
5652
migrator:
57-
image: app:latest-dev
53+
build:
54+
context: .
55+
dockerfile: deploy/docker/dev/Dockerfile
5856
command: litestar database upgrade --no-prompt
5957
restart: "no"
6058
<<: *development-volumes

docker-compose.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ services:
5151
build:
5252
context: .
5353
dockerfile: deploy/docker/run/Dockerfile
54-
image: app:latest
5554
restart: always
5655
depends_on:
5756
db:
@@ -66,7 +65,9 @@ services:
6665
env_file:
6766
- .env.docker.example
6867
worker:
69-
image: app:latest
68+
build:
69+
context: .
70+
dockerfile: deploy/docker/run/Dockerfile
7071
command: litestar workers run
7172
restart: always
7273
depends_on:
@@ -77,7 +78,9 @@ services:
7778
env_file:
7879
- .env.docker.example
7980
migrator:
80-
image: app:latest
81+
build:
82+
context: .
83+
dockerfile: deploy/docker/run/Dockerfile
8184
restart: "no"
8285
command: litestar database upgrade --no-prompt
8386
env_file:

0 commit comments

Comments
 (0)