Files
git.taskfile.build/image/Dockerfile
T
Janik von Rotz 65a3d7624a feat(image): ensure opencode config dir exists and fix symlink for global binary
- Create symlink from /pnpm/bin/opencode to /usr/local/bin/opencode for global access
- Ensure opencode config directory exists at startup using OPENCODE_CONFIG_DIR env var
- Improve task file permission message clarity in entrypoint.sh
2026-06-19 11:57:08 +02:00

37 lines
914 B
Docker

FROM node:22-slim
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME/bin:$PNPM_HOME:$PATH"
RUN corepack enable && \
apt-get update && \
apt-get install -y git hugo caddy curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install uv for Python package management
COPY --from=ghcr.io/astral-sh/uv:0.7.21 /uv /uvx /bin/
# Install opencode-ai via pnpm
RUN pnpm add -g opencode-ai --allow-build=opencode-ai
RUN ln -sf /pnpm/bin/opencode /usr/local/bin/opencode
# Prepare virtual env
RUN uv venv /app/.venv
ENV PATH=/app/.venv:$PATH
# Create opencode config directory under /app for persistence
RUN mkdir -p /app/.config/opencode
ENV OPENCODE_CONFIG_DIR="/app/.config/opencode"
COPY ./bin /usr/local/bin
COPY ./image/entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
CMD ["caddy"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:80/ || exit 1