-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (59 loc) · 3.37 KB
/
Dockerfile
File metadata and controls
74 lines (59 loc) · 3.37 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
65
66
67
68
69
70
71
72
73
74
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive \
TZ=UTC
# ── System dependencies ───────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
curl \
git \
unzip \
wget \
ca-certificates \
gnupg \
python3 \
&& rm -rf /var/lib/apt/lists/*
# ── PHP 8.2 ───────────────────────────────────────────────────────────────────
RUN add-apt-repository ppa:ondrej/php -y \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
php8.2-cli \
php8.2-mbstring \
php8.2-mysql \
php8.2-sqlite3 \
php8.2-xml \
php8.2-curl \
php8.2-zip \
php8.2-bcmath \
php8.2-tokenizer \
&& rm -rf /var/lib/apt/lists/*
# ── Node.js 20 ────────────────────────────────────────────────────────────────
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
# ── Composer ──────────────────────────────────────────────────────────────────
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /app
# ── PHP dependencies (cached layer) ──────────────────────────────────────────
COPY composer.json composer.lock ./
RUN composer install --prefer-dist --no-scripts --no-autoloader --no-progress --no-interaction
# ── Node dependencies + Playwright Chromium (cached layer) ───────────────────
COPY package.json package-lock.json ./
RUN npm ci
RUN npx playwright install chromium --with-deps
# ── Application source ────────────────────────────────────────────────────────
COPY . .
# Remove any stale Vite dev-server hot file that may have been in the build context
RUN rm -f public/hot
# ── Storage & cache directories ───────────────────────────────────────────────
RUN mkdir -p storage/logs \
storage/framework/cache \
storage/framework/sessions \
storage/framework/views \
bootstrap/cache \
&& chmod -R 775 storage bootstrap/cache
# ── Finalise Composer autoload ────────────────────────────────────────────────
RUN composer dump-autoload --optimize
# ── Entrypoint ────────────────────────────────────────────────────────────────
RUN chmod +x /app/docker-entrypoint.sh
EXPOSE 8000 8080
ENTRYPOINT ["/app/docker-entrypoint.sh"]