Aktualizacja Astro 5.0, Poprawka workflow

This commit is contained in:
dm
2025-11-20 21:43:35 +01:00
parent 1e5f2bc38a
commit 742dd280b6
4 changed files with 23 additions and 18 deletions

View File

@@ -10,18 +10,18 @@ jobs:
runs-on: contabo-runner runs-on: contabo-runner
steps: steps:
- name: Pull latest code - name: Update repository
run: | run: |
cd /opt/fuz-site cd /opt/fuz-site
git reset --hard HEAD git reset --hard HEAD
git pull git pull
- name: Build image - name: Build
run: | run: |
cd /opt/fuz-site cd /opt/fuz-site
docker compose -f docker-compose.prod.yml build docker compose -f docker-compose.prod.yml build
- name: Restart service - name: Restart
run: | run: |
cd /opt/fuz-site cd /opt/fuz-site
docker compose -f docker-compose.prod.yml up -d docker compose -f docker-compose.prod.yml up -d

View File

@@ -1,7 +1,7 @@
# ============================ # ===========
# 1) BUILD STAGE # 1) BUILDER
# ============================ # ===========
FROM node:18-alpine AS builder FROM node:20-alpine AS builder
WORKDIR /app WORKDIR /app
@@ -11,17 +11,17 @@ RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
# ============================ # ===========
# 2) RUNTIME STAGE (alpine) # 2) RUNTIME
# ============================ # ===========
FROM node:18-alpine FROM node:20-alpine
WORKDIR /app WORKDIR /app
COPY --from=builder /app /app COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
ENV NODE_ENV=production COPY package*.json ./
EXPOSE 3000 EXPOSE 3000
CMD ["node", "dist/server/entry.mjs"] CMD ["node", "./dist/server/entry.mjs"]

View File

@@ -1,9 +1,13 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind'; import tailwind from '@astrojs/tailwind';
import node from '@astrojs/node';
export default defineConfig({ export default defineConfig({
srcDir: 'src', srcDir: 'src',
output: 'server', output: 'server',
adapter: node({
mode: "standalone"
}),
integrations: [ integrations: [
tailwind({ tailwind({
applyBaseStyles: true applyBaseStyles: true

View File

@@ -8,13 +8,14 @@
"preview": "astro preview" "preview": "astro preview"
}, },
"dependencies": { "dependencies": {
"astro": "^4.0.0", "@astrojs/node": "^9.5.1",
"astro": "^5.16.0",
"js-yaml": "^4.1.0" "js-yaml": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@astrojs/tailwind": "^5.0.0", "@astrojs/tailwind": "^5.0.0",
"tailwindcss": "^3.4.0",
"autoprefixer": "^10.4.0", "autoprefixer": "^10.4.0",
"postcss": "^8.4.0" "postcss": "^8.4.0",
"tailwindcss": "^3.4.0"
} }
} }