Skip to content

Commit

Permalink
fix: PWA config and other minor improvements (#2551)
Browse files Browse the repository at this point in the history
* fix: typos

* fix: fix from review + from vercel/next.js diff
  • Loading branch information
vincentchalamon committed Oct 26, 2023
1 parent 1e1db12 commit 3f68518
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
name: Lint Dockerfiles
uses: hadolint/hadolint-action@v3.1.0
with:
recursive: true
recursive: true
2 changes: 1 addition & 1 deletion api/frankenphp/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
if [ ! -d 'vendor/' ]; then
if [ -z "$(ls -A 'vendor/' 2>/dev/null)" ]; then
composer install --prefer-dist --no-progress --no-interaction
fi

Expand Down
2 changes: 1 addition & 1 deletion compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}

pwa:
build:
build:
context: ./pwa
target: prod

Expand Down
2 changes: 2 additions & 0 deletions helm/api-platform/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ data:
php-trusted-proxies: "{{ join "," .Values.php.trustedProxies }}"
mercure-url: "http://{{ include "api-platform.fullname" . }}/.well-known/mercure"
mercure-public-url: {{ .Values.mercure.publicUrl | default "http://127.0.0.1/.well-known/mercure" | quote }}
mercure-extra-directives: {{ .Values.mercure.extraDirectives | quote }}
caddy-global-options: {{ .Values.php.caddyGlobalOptions | quote }}
10 changes: 10 additions & 0 deletions helm/api-platform/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ spec:
secretKeyRef:
name: {{ include "api-platform.fullname" . }}
key: database-url
- name: CADDY_GLOBAL_OPTIONS
valueFrom:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: caddy-global-options
- name: MERCURE_URL
valueFrom:
configMapKeyRef:
Expand All @@ -95,6 +100,11 @@ spec:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: mercure-public-url
- name: MERCURE_EXTRA_DIRECTIVES
valueFrom:
configMapKeyRef:
name: {{ include "api-platform.fullname" . }}
key: mercure-extra-directives
- name: MERCURE_JWT_SECRET
valueFrom:
secretKeyRef:
Expand Down
1 change: 1 addition & 0 deletions helm/api-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ php:
- "10.0.0.0/8"
- "172.16.0.0/12"
- "192.168.0.0/16"
caddyGlobalOptions: ""

pwa:
image:
Expand Down
6 changes: 5 additions & 1 deletion pwa/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ RUN addgroup --system --gid 1001 nodejs; \

COPY --from=builder --link /srv/app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next; \
chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --link --chown=1001:1001 /srv/app/.next/standalone ./
Expand All @@ -69,6 +73,6 @@ USER nextjs
EXPOSE 3000

ENV PORT 3000
ENV HOSTNAME localhost
ENV HOSTNAME "0.0.0.0"

CMD ["node", "server.js"]

0 comments on commit 3f68518

Please sign in to comment.