Skip to content

Commit 6b78f39

Browse files
committed
fix: kics
1 parent 3b1a261 commit 6b78f39

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ APT::Install-Suggests "false";
3131
APT::AutoRemove::RecommendsImportant "false";
3232
APT::AutoRemove::SuggestsImportant "false";
3333
EOF
34+
3435
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
3536
--mount=type=cache,target=/var/lib/apt,sharing=locked \
3637
rm -f /etc/apt/apt.conf.d/docker-clean && \
3738
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
3839
apt-get update && \
3940
apt-get install --yes --no-install-recommends \
40-
build-essential \
41-
curl
41+
build-essential=12.10ubuntu1 \
42+
curl=8.9.1-2ubuntu2.2
4243

4344
ARG PIP_DISABLE_PIP_VERSION_CHECK=1 \
4445
PIP_NO_CACHE_DIR=0 \
@@ -49,7 +50,7 @@ ARG PIP_DISABLE_PIP_VERSION_CHECK=1 \
4950

5051
# set up python
5152
COPY --from=ghcr.io/astral-sh/uv:latest@sha256:63b7453435641145dc3afab79a6bc2b6df6f77107bec2d0df39fd27b1c791c0a /uv /uvx /bin/
52-
COPY --chown=${USER}:${USER} pyproject.toml uv.lock ./
53+
COPY pyproject.toml uv.lock ./
5354
RUN --mount=type=cache,target=/root/.cache/uv \
5455
uv venv --seed ${VIRTUAL_ENV} && \
5556
uv sync --frozen --no-default-groups --no-install-project && \
@@ -58,7 +59,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5859
uv pip list
5960

6061
# set up project
61-
COPY --chown=${USER}:${USER} src src
62+
COPY src src
6263
RUN --mount=type=cache,target=/root/.cache/uv \
6364
uv sync --frozen --no-default-groups
6465

@@ -79,8 +80,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7980
chown -R ${USER}:${USER} ${VIRTUAL_ENV} && \
8081
uv pip list
8182

82-
COPY --chown=${USER}:${USER} tests tests
83-
COPY --chown=${USER}:${USER} Makefile Makefile
83+
COPY tests tests
84+
COPY Makefile Makefile
8485

8586
CMD ["make", "lint", "test"]
8687

@@ -91,8 +92,8 @@ FROM base AS prod
9192

9293
# set up project
9394
USER ${USER}
94-
COPY --from=dev --chown=${USER}:${USER} ${VIRTUAL_ENV} ${VIRTUAL_ENV}
95-
COPY --from=dev --chown=${USER}:${USER} ${APP_HOME} ${APP_HOME}
95+
COPY --from=dev ${VIRTUAL_ENV} ${VIRTUAL_ENV}
96+
COPY --from=dev ${APP_HOME} ${APP_HOME}
9697

9798
EXPOSE 8000
9899
ARG ENVIRONMENT=prod

compose.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ services:
99
cache_to:
1010
- type=inline
1111
target: dev
12+
healthcheck:
13+
test: curl -f http://localhost/ || exit 1
1214
ports:
13-
- "8000:8000"
15+
- "127.0.0.1:8000:8000"
1416
volumes:
1517
- .:/opt/app
1618
profiles:
@@ -26,8 +28,10 @@ services:
2628
cache_to:
2729
- type=inline
2830
target: ci
31+
healthcheck:
32+
test: curl -f http://localhost/ || exit 1
2933
ports:
30-
- "8000:8000"
34+
- "127.0.0.1:8000:8000"
3135
profiles:
3236
- ci
3337
app:
@@ -40,7 +44,9 @@ services:
4044
- ghcr.io/yxtay/python-example-app:ci
4145
- ghcr.io/yxtay/python-example-app:main
4246
target: prod
47+
healthcheck:
48+
test: curl -f http://localhost/ || exit 1
4349
ports:
44-
- "8000:8000"
50+
- "127.0.0.1:8000:8000"
4551
profiles:
4652
- prod

0 commit comments

Comments
 (0)