-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (45 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
58 lines (45 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Use the official Docker Hub Ubuntu base image
FROM ubuntu:24.04
LABEL org.opencontainers.image.version="2026.02.27"
LABEL org.opencontainers.image.title="OpenRelik Worker for THOR Lite"
LABEL org.opencontainers.image.source="https://github.com/NextronSystems/openrelik-worker-thor-lite"
# Prevent needing to configure debian packages, stopping the setup of
# the docker container.
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Install poetry and any other dependency that your worker needs.
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
# Add your dependencies here
ca-certificates \
unzip \
&& rm -rf /var/lib/apt/lists/*
# ----------------------------------------------------------------------
# Install THOR Lite
# ----------------------------------------------------------------------
WORKDIR /thor-lite
RUN curl -o thorlite-linux.zip "https://update1.nextron-systems.com/getupdate.php?product=thor10lite-linux&dev=1" \
&& unzip thorlite-linux.zip \
&& rm thorlite-linux.zip \
&& chmod +x thor-lite-linux-64
# ----------------------------------------------------------------------
# Configure debugging
ARG OPENRELIK_PYDEBUG
ENV OPENRELIK_PYDEBUG=${OPENRELIK_PYDEBUG:-0}
ARG OPENRELIK_PYDEBUG_PORT
ENV OPENRELIK_PYDEBUG_PORT=${OPENRELIK_PYDEBUG_PORT:-5678}
# Set working directory
WORKDIR /openrelik
# Install the latest uv binaries
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Copy poetry toml and install dependencies
COPY uv.lock pyproject.toml .
# Install the project's dependencies using the lockfile and settings
RUN uv sync --locked --no-install-project --no-dev
# Copy project files
COPY . ./
# Installing separately from its dependencies allows optimal layer caching
RUN uv sync --locked --no-dev
# Install the worker and set environment to use the correct python interpreter.
ENV PATH="/openrelik/.venv/bin:$PATH"
# Default command if not run from docker-compose (and command being overidden)
CMD ["celery", "--app=src.tasks", "worker", "--task-events", "--concurrency=1", "--loglevel=DEBUG"]