-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile.jl4-lsp
More file actions
48 lines (35 loc) · 1.07 KB
/
Dockerfile.jl4-lsp
File metadata and controls
48 lines (35 loc) · 1.07 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
# Multi-stage build for jl4-lsp
FROM haskell:9.10.2 AS builder
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy cabal project files
COPY cabal.project .
COPY jl4-core/jl4-core.cabal jl4-core/
COPY jl4/jl4.cabal jl4/
COPY jl4-lsp/jl4-lsp.cabal jl4-lsp/
# Update cabal and build dependencies (cached layer)
RUN cabal update && cabal build --only-dependencies jl4-lsp
# Copy source code
COPY jl4-core jl4-core
COPY jl4 jl4
COPY jl4-lsp jl4-lsp
# Build the project
RUN cabal build jl4-lsp && \
cabal install jl4-lsp --installdir=/opt/jl4-lsp --install-method=copy
# Runtime stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libgmp10 \
libffi8 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binary from builder
COPY --from=builder /opt/jl4-lsp/jl4-lsp /usr/local/bin/
# Copy libraries for LSP
COPY jl4-core/libraries /app/libraries
EXPOSE 8000
CMD ["jl4-lsp", "ws", "--host", "0.0.0.0", "--port", "8000", "--cwd", "/app/libraries"]