Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen

# ============================================
# Stage 2: Production stage
# Stage 2: Production stage (base)
# ============================================

FROM python:3.13-slim-bookworm
FROM python:3.13-slim-bookworm AS base

LABEL org.opencontainers.image.source="https://github.com/aboutcode-org/scancode.io"
LABEL org.opencontainers.image.description="ScanCode.io"
Expand Down Expand Up @@ -94,8 +94,6 @@ RUN apt-get update \
libzstd1 \
libgpgme11 \
libdevmapper1.02.1 \
libguestfs-tools \
linux-image-amd64 \
git \
wait-for-it \
universal-ctags \
Expand All @@ -122,3 +120,18 @@ USER $APP_USER

# Create static/ and workspace/ directories
RUN mkdir -p /var/$APP_NAME/static/ /var/$APP_NAME/workspace/

# ============================================
# Stage 3: Full image (with VM inspection)
# ============================================

FROM base AS full

USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libguestfs-tools \
linux-image-amd64 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER $APP_USER
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ docs:
@${ACTIVATE} sphinx-build docs/ docs/_build/

build:
docker build -t $(IMAGE_NAME) .
docker build --target base -t $(IMAGE_NAME) .

build-full:
docker build --target full -t $(IMAGE_NAME) .

bash:
docker run -it $(IMAGE_NAME) bash
Expand Down
19 changes: 15 additions & 4 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@
# $ SCANCODEIO_TEST_FIXTURES_REGEN=1 ./manage.py test

name: scancodeio

x-dev-env: &dev-env
SCANCODEIO_DEBUG: "True"
GUNICORN_RELOAD_FLAG: "--reload"

x-dev-build: &dev-build
context: .
target: base

services:
web:
env_file:
- docker.dev.env
build: *dev-build
environment:
<<: *dev-env
volumes:
- ./scanpipe:/opt/scancodeio/scanpipe

worker:
env_file:
- docker.dev.env
build: *dev-build
environment:
<<: *dev-env
develop:
watch:
- action: sync+restart
Expand Down
2 changes: 0 additions & 2 deletions docker.dev.env

This file was deleted.

Loading