Update Astro and Payload dependencies

This commit is contained in:
Max Schmidt 2023-06-07 10:21:48 +02:00
parent 3a39f967ef
commit 36678d38b7
8 changed files with 417 additions and 557 deletions

View File

@ -29,8 +29,9 @@ Secrets:
Variables: Variables:
- ASTRO_URL: URL of the Frontend - ASTRO_HOST: Hostdomain of the Frontend
- PAYLOAD_URL: URL of the CMS - PAYLOAD_HOST: Hostdomain of the CMS
- PAYLOAD_SERVER_URL: URL of the CMS
- NAME: Name of the Container and Project - NAME: Name of the Container and Project
Please remember to set these secrets and variables in your repository settings to ensure a successful deployment through Github Workflows. Please remember to set these secrets and variables in your repository settings to ensure a successful deployment through Github Workflows.

1
astro/.gitignore vendored
View File

@ -6,6 +6,7 @@ dist/
# dependencies # dependencies
node_modules/ node_modules/
yarn.lock
# logs # logs
npm-debug.log* npm-debug.log*

View File

@ -8,16 +8,16 @@
"build": "astro build" "build": "astro build"
}, },
"dependencies": { "dependencies": {
"@astrojs/image": "^0.16.8", "@astrojs/image": "^0.17.0",
"@astrojs/prefetch": "^0.2.1", "@astrojs/prefetch": "^0.2.3",
"@astrojs/sitemap": "^1.3.1", "@astrojs/sitemap": "^1.3.3",
"@astrojs/tailwind": "3.1.2", "@astrojs/tailwind": "3.1.3",
"astro": "^2.4.5", "astro": "^2.6.1",
"astro-compress": "^1.1.43", "astro-compress": "^1.1.47",
"astro-critters": "^1.1.34", "astro-critters": "^1.1.38",
"css-select": "5.1.0", "css-select": "5.1.0",
"sharp": "^0.32.1", "sharp": "^0.32.1",
"slate-serializers": "0.0.32", "slate-serializers": "0.1.0",
"tailwindcss": "^3.0.24" "tailwindcss": "^3.0.24"
} }
} }

View File

@ -2,7 +2,7 @@ import type { Post } from "../types";
const url = import.meta.env.DEV const url = import.meta.env.DEV
? "http://payload:3001" ? "http://payload:3001"
: `https://${import.meta.env.PAYLOAD_URL}`; : `${import.meta.env.PAYLOAD_SERVER_URL}`;
export const getPosts = async () => export const getPosts = async () =>
(await (await fetch(`${url}/api/posts`)).json()).docs as Post[]; (await (await fetch(`${url}/api/posts`)).json()).docs as Post[];

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@ services:
context: astro context: astro
target: prod target: prod
environment: environment:
PAYLOAD_URL: ${PAYLOAD_URL} PAYLOAD_SERVER_URL: ${PAYLOAD_SERVER_URL}
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.${NAME}-astro.rule=Host(`${ASTRO_URL}`)" - "traefik.http.routers.${NAME}-astro.rule=Host(`${ASTRO_HOST}`)"
- "traefik.http.routers.${NAME}-astro.entrypoints=https" - "traefik.http.routers.${NAME}-astro.entrypoints=https"
- "traefik.http.routers.${NAME}-astro.tls.certresolver=httpresolver" - "traefik.http.routers.${NAME}-astro.tls.certresolver=httpresolver"
- "traefik.http.routers.${NAME}-astro.middlewares=security-headers-${NAME}-astro" - "traefik.http.routers.${NAME}-astro.middlewares=security-headers-${NAME}-astro"
@ -39,7 +39,7 @@ services:
- ./data/media:/prod/dist/media - ./data/media:/prod/dist/media
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.${NAME}-payload.rule=Host(`${PAYLOAD_URL}`) - traefik.http.routers.${NAME}-payload.rule=Host(`${PAYLOAD_HOST}`)
- traefik.http.routers.${NAME}-payload.entrypoints=https - traefik.http.routers.${NAME}-payload.entrypoints=https
- traefik.http.routers.${NAME}-payload.tls.certresolver=httpresolver - traefik.http.routers.${NAME}-payload.tls.certresolver=httpresolver
- traefik.docker.network=traefik_network - traefik.docker.network=traefik_network

View File

@ -18,7 +18,7 @@ services:
PAYLOAD_PORT: ${PAYLOAD_PORT} PAYLOAD_PORT: ${PAYLOAD_PORT}
PAYLOAD_SECRET: ${PAYLOAD_SECRET} PAYLOAD_SECRET: ${PAYLOAD_SECRET}
MONGODB_URI: ${MONGODB_URI} MONGODB_URI: ${MONGODB_URI}
PAYLOAD_URL: ${PAYLOAD_URL} PAYLOAD_SERVER_URL: ${PAYLOAD_SERVER_URL}
TOKEN: ${TOKEN} TOKEN: ${TOKEN}
networks: networks:
- front - front

View File

@ -14,14 +14,14 @@
}, },
"dependencies": { "dependencies": {
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"dotenv": "^8.2.0", "dotenv": "^16.1.4",
"express": "^4.17.1", "express": "^4.17.1",
"payload": "^1.8.2" "payload": "^1.8.5"
}, },
"devDependencies": { "devDependencies": {
"@types/express": "^4.17.9", "@types/express": "^4.17.9",
"nodemon": "^2.0.6", "nodemon": "^2.0.6",
"ts-node": "^9.1.1", "ts-node": "^10.9.1",
"typescript": "^4.1.3" "typescript": "^5.1.3"
} }
} }