-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (49 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
64 lines (49 loc) · 1.75 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
61
62
63
64
FROM ubuntu:22.04
# Set non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive
# Set working directory
WORKDIR /build
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl git wget \
python3 python3-pip \
build-essential libgl1-mesa-glx libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /bin/python3 /bin/python \
&& ln -sf /bin/pip3 /bin/pip
# Install Node.js 16 (using NodeSource official repository)
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Verify Node.js version
RUN node --version && npm --version
# Install Python dependencies (including deepface for advanced face detection)
RUN pip3 config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/ \
&& pip3 install --no-cache-dir \
Pillow \
opencv-python \
numpy \
deepface tf-keras
# Copy project files (.dockerignore will exclude unnecessary files)
COPY . /build
# Set executable permission for bootstrap.sh
RUN chmod +x /build/bootstrap.sh
# Create target directories
RUN mkdir -p /www /www/album
# Build webpage only, do not generate APIs (APIs will be generated at runtime based on mounted album directory)
RUN /build/bootstrap.sh \
--build-webpage-only \
--prefix=/www \
--install-deps \
|| exit 1
# Install http-server for serving static website
RUN npm install -g http-server
# Copy entrypoint script
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Expose port
EXPOSE 8080
# Set working directory to /www
WORKDIR /www
# Use entrypoint script to start
ENTRYPOINT ["/docker-entrypoint.sh"]