-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
48 lines (36 loc) · 1.11 KB
/
Dockerfile.dev
File metadata and controls
48 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Development Dockerfile for openscadgen
# Includes all development tools and live reloading
FROM golang:1.23-bookworm
# Install development dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
openscad \
bash \
curl \
ca-certificates \
tzdata \
make \
&& rm -rf /var/lib/apt/lists/*
# Install templ for template generation
RUN go install github.com/a-h/templ/cmd/templ@latest
# Set working directory
WORKDIR /app
# Copy go mod files first for better caching
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Install BOSL2 library for OpenSCAD from source
RUN mkdir -p /usr/share/openscad/libraries && \
git clone --depth 1 https://github.com/BelfrySCAD/BOSL2.git /usr/share/openscad/libraries/BOSL2 && \
rm -rf /usr/share/openscad/libraries/BOSL2/.git
# Generate templ files
RUN templ generate
# Build the application
RUN go build -o openscadgen .
# Expose port for server mode
EXPOSE 6767
# Default command - docker-compose will override this
CMD ["./openscadgen", "-sf", "./examples/", "-p", "6767"]