Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.gitignore
.github
*.md
test-*.sh
install-*.sh
Cargo.lock
Cargo.toml
examples/
.env
.env.local
*.log
node_modules/
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/cli.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/lib.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/release.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/web-deploy.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/web.yml

This file was deleted.

35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM python:3.11-slim

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy Python modules
COPY label_history.py label_archiver.py webhook_notifier.py svg-to-gcode-daemon.py ./

# Create requirements.txt and install dependencies
RUN echo "Flask>=2.0.0\nrequests>=2.28.0" > requirements.txt && \
pip install --no-cache-dir -r requirements.txt

# Create non-root user (matching systemd deployment)
RUN useradd -r -s /bin/false svg2gcode && \
chown -R svg2gcode:svg2gcode /app

# Create required directories
RUN mkdir -p /var/lib/svg-to-gcode /var/log/svg-to-gcode /etc/svg-to-gcode && \
chown -R svg2gcode:svg2gcode /var/lib/svg-to-gcode /var/log/svg-to-gcode /etc/svg-to-gcode

USER svg2gcode

EXPOSE 8765

# Health check (using REST API health endpoint)
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8765/health || exit 1

# Entry point: run daemon directly (Flask development server)
ENTRYPOINT ["python3", "svg-to-gcode-daemon.py"]
CMD ["--config", "/etc/svg-to-gcode/config.json", "--host", "0.0.0.0", "--port", "8765"]
42 changes: 42 additions & 0 deletions Dockerfile.phase1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM rust:latest as builder

WORKDIR /build

# Copy Rust project files
COPY Cargo.toml Cargo.lock ./
COPY cli ./cli
COPY g_code ./g_code
COPY star ./star
COPY web ./web

# Build the CLI tool (release mode for optimization)
RUN cargo build --release --bin svg2gcode

# Final image - lightweight
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
lsof \
&& rm -rf /var/lib/apt/lists/*

# Copy binary from builder
COPY --from=builder /build/target/release/svg2gcode /usr/local/bin/svg2gcode-cli

# Copy watcher script
COPY svg2gcode-watcher.sh /usr/local/bin/svg2gcode-watcher.sh
RUN chmod +x /usr/local/bin/svg2gcode-watcher.sh

# Create non-root user
RUN useradd -r -s /bin/false svg2gcode

USER svg2gcode

WORKDIR /data

# Health check - verify binary works
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD svg2gcode-cli --help > /dev/null 2>&1 || exit 1

ENTRYPOINT ["/usr/local/bin/svg2gcode-watcher.sh"]
CMD ["/data", "2"]
Loading