File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1+ disable =SC1008
Original file line number Diff line number Diff line change 1- ARG BUILD_FROM
21ARG BUILDARCH
32# Stage 1: Build Go binary and clone repo
4- FROM --platform=$BUILDARCH golang:1.22 AS builder
3+ FROM golang:1.22 AS builder
54
65RUN git clone https://github.com/karam-ajaj/atlas.git /atlas-repo
76WORKDIR /atlas-repo
@@ -13,17 +12,19 @@ RUN go mod init atlas || true
1312RUN go build -o /atlas .
1413
1514# Stage 2: Runtime
15+ ARG BUILD_FROM
1616FROM $BUILD_FROM
1717
1818RUN apk add --no-cache \
19- nginx iputils-ping traceroute nmap sqlite net-tools curl jq ca-certificates git py3-pip
19+ nginx iputils-ping traceroute nmap sqlite net-tools curl jq ca-certificates git py3-pip && \
20+ python3 -m venv /opt/venv
2021
2122# Create a virtual environment
22- RUN python3 -m venv /opt/venv
23- ENV PATH="/opt/venv/bin:$PATH"
2423
2524# Install python packages
26- RUN . /opt/venv/bin/activate && pip install --no-cache-dir fastapi uvicorn
25+ ENV PATH="/opt/venv/bin:$PATH"
26+ # hadolint ignore=SC1091
27+ RUN source /opt/venv/bin/activate && pip install --no-cache-dir fastapi uvicorn
2728
2829# Remove default Nginx config
2930RUN rm -f /etc/nginx/conf.d/default.conf /etc/nginx/sites-enabled/default || true
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ ATLAS_API_PORT=$(bashio::addon.port 8889)
1515# Render Nginx config (IMPORTANT: restrict variables so $uri etc. survive)
1616if [[ -f /config/nginx/default.conf.template ]]; then
1717 log " Rendering Nginx template (UI:$ATLAS_UI_PORT API:$ATLAS_API_PORT )"
18- envsubst ' ${ATLAS_UI_PORT} ${ATLAS_API_PORT}' < /config/nginx/default.conf.template > /etc/nginx/conf.d/default.conf
18+ envsubst " ${ATLAS_UI_PORT} ${ATLAS_API_PORT} " < /config/nginx/default.conf.template > /etc/nginx/conf.d/default.conf
1919else
2020 log " ⚠️ Template /config/nginx/default.conf.template missing. Using existing config."
2121fi
4141log " 🚀 Starting FastAPI backend on port $ATLAS_API_PORT ..."
4242export PYTHONPATH=/config
4343uvicorn app:app --host 0.0.0.0 --port " $ATLAS_API_PORT " > /config/logs/uvicorn.log 2>&1 &
44- API_PID=$!
44+ export API_PID=$!
4545
4646# Kick off scans (non-blocking)
4747if [[ -x /config/bin/atlas ]]; then
You can’t perform that action at this time.
0 commit comments