# Use the specified Docker image
FROM ghcr.io/deco-cx/deco:latest
# Set environment variables
ENV DECO_ENV_NAME=test-env \
DECO_SITE_NAME=selfhostmgr \
DECO_TRACKING_BRANCH=main \
DECO_APP_NAME=site \
DECO_REPO_URL=git@github.com:deco-sites/selfhostmgr.git
# Create .ssh directory and add GitHub known hosts
RUN mkdir -p /home/deno/.ssh && \
ssh-keyscan github.com >> /home/deno/.ssh/known_hosts
# Copy the SSH key into the container (assuming you have it locally)
# Replace "id_rsa" with the actual filename of your private key
COPY ssh/id_ed25519 /home/deno/.ssh/
COPY ssh/id_ed25519.pub /home/deno/.ssh/
USER root
RUN chmod -R 700 /home/deno/.ssh
RUN chown -R deno /home/deno/.ssh
USER deno
# Additional commands for your application (if needed)
# e.g., cloning the repository, setting up dependencies, etc.
# RUN git clone $DECO_REPO_URL /app
CMD DENO_DIR_RUN=/app/deno DENO_DIR=/daemon-deno-dir deno run -A --unstable-http jsr:@deco/deco/scripts/run --build-cmd "deno task build" -- deno run --lock=deno.lock --unstable-http --lock-write --inspect --node-modules-dir=false --allow-ffi=$DENO_DIR"npm/registry.npmjs.org/@libsql" --allow-env --allow-net --allow-sys --allow-hrtime --allow-read --allow-run --allow-write=$HOME/.cache,/tmp,/deno-dir/npm,/deno-dir/deno_esbuild,/deno-dir/deno_esbuild_tmp, --unstable --unstable-hmr --unstable-kv --unstable-cron main.ts