mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-08-17 21:25:49 +02:00
60 lines
1.5 KiB
Docker
60 lines
1.5 KiB
Docker
# Osmedeus Production Dockerfile
|
|
# Ubuntu/Debian-based image with essential tools for security scanning
|
|
|
|
FROM golang:1.26-bookworm
|
|
|
|
WORKDIR /app
|
|
|
|
# Install essential tools (retry on transient network failures for large packages like chromium)
|
|
RUN apt-get update && \
|
|
for i in 1 2 3; do \
|
|
apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
git \
|
|
curl \
|
|
wget \
|
|
jq \
|
|
ca-certificates \
|
|
python3 \
|
|
python3-pip \
|
|
chromium \
|
|
&& break || { echo "Attempt $i failed, retrying..."; apt-get update; }; \
|
|
done && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
ln -sf /usr/bin/python3 /usr/bin/python
|
|
|
|
# Copy go mod files first for better layer caching
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the binary
|
|
ARG VERSION=5.0.0
|
|
ARG BUILD_TIME
|
|
ARG COMMIT_HASH
|
|
RUN CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags "-s -w -X main.BuildTime=${BUILD_TIME} -X main.CommitHash=${COMMIT_HASH}" \
|
|
-o /usr/local/bin/osmedeus ./cmd/osmedeus
|
|
|
|
# Create base directories
|
|
RUN mkdir -p /root/osmedeus-base /root/workspaces-osmedeus
|
|
|
|
WORKDIR /root
|
|
|
|
# Initialize osmedeus base folder with preset workflows
|
|
RUN osmedeus install base --preset
|
|
|
|
# Set up PATH for external binaries
|
|
ENV PATH="/root/osmedeus-base/external-binaries:${PATH}"
|
|
|
|
# Expose default server port
|
|
EXPOSE 8002
|
|
|
|
# Default entrypoint - exposes osmedeus CLI only
|
|
ENTRYPOINT ["osmedeus"]
|
|
|
|
# Default command shows help (user can override with run/server/etc.)
|
|
CMD ["--help"]
|