-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 1.01 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
# Use Perl official image
FROM perl:5.38-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
libpq-dev \
postgresql-client \
cpanminus \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy dependency files first for better layer caching
COPY cpanfile Makefile.PL ./
# Install Perl dependencies from project definition and force critical modules
RUN cpanm --notest --installdeps . \
&& cpanm --notest Crypt::Argon2 DBD::Pg Starman \
&& perl -MCrypt::Argon2 -e 1
# Copy application files
COPY . .
# Set environment variables defaults (can be overridden)
ENV DANCER_ENVIRONMENT=production \
DANCER_PORT=5000
# Expose port
EXPOSE 5000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:5000/ || exit 1
# Run the application with Starman (production PSGI server)
CMD ["starman", "--port", "5000", "--workers", "4", "bin/app.psgi"]