forked from potree/PotreeConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.tapis
More file actions
60 lines (46 loc) · 1.41 KB
/
Dockerfile.tapis
File metadata and controls
60 lines (46 loc) · 1.41 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
56
57
58
59
60
# Multi-stage build for PotreeConverter
FROM ubuntu:22.04 AS builder
# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
libtbb-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy source code
COPY . .
# Create build directory and build
RUN mkdir -p build && \
cd build && \
cmake ../ && \
make -j$(nproc)
# Runtime stage
FROM ubuntu:22.04
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libtbb12 \
python3 \
acl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -s /bin/bash potree
# Copy built executable, shared libraries, and resources
COPY --from=builder /app/build/PotreeConverter /home/potree/
COPY --from=builder /app/build/liblaszip.so* /usr/local/lib/
COPY --from=builder /app/build/resources /home/potree/resources
COPY --from=builder /app/build/licenses /home/potree/licenses
# Update library cache and set proper permissions
RUN ldconfig && chmod +x /home/potree/PotreeConverter && \
chmod -R 755 /home/potree
# Switch to non-root user
USER potree
WORKDIR /home/potree
COPY scripts/potree_scene_generator.py .
COPY --chmod=755 run.sh /tapis/run.sh
COPY --chmod=755 scripts/potree_scene_generator.py /tapis/potree_scene_generator.py
# Default command
ENTRYPOINT [ "/tapis/run.sh" ]