-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (27 loc) · 870 Bytes
/
Dockerfile
File metadata and controls
42 lines (27 loc) · 870 Bytes
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
FROM dunglas/frankenphp:1-php8.2-alpine AS base
ARG FOLDER=/app
# Docker build stage
FROM base AS builder
WORKDIR ${FOLDER}
RUN apk add --no-cache \
git \
curl \
unzip \
bash \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& mkdir -p /data/caddy/locks
RUN addgroup -g 1000 devgroup && \
adduser -u 1000 -G devgroup -s /bin/sh -D devuser
COPY --chown=devuser:devgroup . /app
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Docker running stage
FROM base AS runner
WORKDIR ${FOLDER}
RUN addgroup -g 1000 devgroup && \
adduser -u 1000 -G devgroup -s /bin/sh -D devuser \
&& mkdir -p /data/caddy/locks
COPY --from=builder --chown=devuser:devgroup /app /app
USER devuser
EXPOSE 80
WORKDIR ${FOLDER}/public
CMD ["frankenphp", "php-server"]