Skip to content

Commit 2fc01ab

Browse files
Claudesamdark
andauthored
Fix #275: Add explicit Caddyfiles for dev and prod
Co-authored-by: samdark <47294+samdark@users.noreply.github.com> Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com> Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
1 parent 6e4eded commit 2fc01ab

5 files changed

Lines changed: 44 additions & 2 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# except:
55

6+
!/docker/**/Caddyfile
67
!/config
78
!/public
89
!/src

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Yii API template Change Log
22

3-
## 1.3.1 under development
3+
## 1.4.0 under development
44

5-
- no changes in this release.
5+
- New #275: Add explicit `Caddyfile`s for dev and prod (@samdark)
66

77
## 1.3.0 April 06, 2026
88

docker/Caddyfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Production mode config
2+
# https://frankenphp.dev/docs/config
3+
# https://caddyserver.com/docs/caddyfile
4+
5+
{
6+
skip_install_trust
7+
8+
frankenphp {
9+
10+
}
11+
}
12+
13+
{$SERVER_NAME::80} {
14+
encode zstd br gzip
15+
php_server {
16+
try_files {path} index.php
17+
root /app/public
18+
}
19+
}

docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ RUN \
4646
chown -R ${USER_NAME}:${GROUP_NAME} /data/caddy && chown -R ${USER_NAME}:${GROUP_NAME} /config/caddy
4747
USER ${USER_NAME}
4848

49+
COPY docker/dev/Caddyfile /etc/frankenphp/Caddyfile
50+
4951
#
5052
# Production
5153
#
@@ -59,5 +61,6 @@ RUN --mount=type=cache,target=/tmp/cache \
5961

6062
FROM base AS prod
6163
ENV APP_ENV=prod
64+
COPY docker/Caddyfile /etc/frankenphp/Caddyfile
6265
COPY --from=prod-builder --chown=www-data:www-data /app /app
6366
USER www-data

docker/dev/Caddyfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Development mode config
2+
# https://frankenphp.dev/docs/config
3+
# https://caddyserver.com/docs/caddyfile
4+
5+
{
6+
skip_install_trust
7+
8+
frankenphp {
9+
10+
}
11+
}
12+
13+
{$SERVER_NAME::80} {
14+
encode zstd br gzip
15+
php_server {
16+
try_files {path} index.php
17+
root /app/public
18+
}
19+
}

0 commit comments

Comments
 (0)