-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·55 lines (40 loc) · 1.91 KB
/
Dockerfile
File metadata and controls
executable file
·55 lines (40 loc) · 1.91 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
49
50
51
52
53
54
55
FROM golang:1.24-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git ca-certificates tzdata docker-cli openssh-client
# Set working directory
WORKDIR /app
# Copy go mod files
COPY HelixCode/go.mod HelixCode/go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY HelixCode/ .
# Build all components
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.version=1.0.0 -X main.buildTime=$(date +%Y-%m-%d_%H:%M:%S) -X main.gitCommit=$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" -o bin/server ./cmd/server
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.version=1.0.0 -X main.buildTime=$(date +%Y-%m-%d_%H:%M:%S) -X main.gitCommit=$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" -o bin/cli ./cmd/cli
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.version=1.0.0 -X main.buildTime=$(date +%Y-%m-%d_%H:%M:%S) -X main.gitCommit=$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" -o bin/terminal-ui ./applications/terminal-ui
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache docker-cli docker-compose postgresql-client redis bash openssh-client curl ca-certificates tzdata
# Create app directory
WORKDIR /app
# Copy built binaries
COPY --from=builder /app/bin/ .
COPY --from=builder /app/assets/ ./assets/
COPY --from=builder /app/config/ ./config/
# Create directories for project mounting
RUN mkdir -p /workspace /projects /shared
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Expose ports
EXPOSE 8080 2222 3000
# Set environment variables
ENV HELIX_ENV=production
ENV HELIX_DATABASE_URL=postgres://helix:helixpass@postgres:5432/helixcode_prod?sslmode=disable
ENV HELIX_REDIS_URL=redis://redis:6379
ENV HELIX_WORKSPACE=/workspace
ENV HELIX_PROJECTS=/projects
ENV HELIX_SHARED=/shared
# Set entrypoint
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]