diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 1dc0a08..f2825b7 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -10,18 +10,18 @@ jobs: runs-on: contabo-runner steps: - - name: Pull latest code + - name: Update repository run: | cd /opt/fuz-site git reset --hard HEAD git pull - - name: Build image + - name: Build run: | cd /opt/fuz-site docker compose -f docker-compose.prod.yml build - - name: Restart service + - name: Restart run: | cd /opt/fuz-site docker compose -f docker-compose.prod.yml up -d diff --git a/Dockerfile b/Dockerfile index 76a7d2a..9e0c876 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -# ============================ -# 1) BUILD STAGE -# ============================ -FROM node:18-alpine AS builder +# =========== +# 1) BUILDER +# =========== +FROM node:20-alpine AS builder WORKDIR /app @@ -11,17 +11,17 @@ RUN npm install COPY . . RUN npm run build -# ============================ -# 2) RUNTIME STAGE (alpine) -# ============================ -FROM node:18-alpine +# =========== +# 2) RUNTIME +# =========== +FROM node:20-alpine WORKDIR /app -COPY --from=builder /app /app - -ENV NODE_ENV=production +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/node_modules ./node_modules +COPY package*.json ./ EXPOSE 3000 -CMD ["node", "dist/server/entry.mjs"] +CMD ["node", "./dist/server/entry.mjs"] diff --git a/astro.config.mjs b/astro.config.mjs index f909cf2..68029c1 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,9 +1,13 @@ import { defineConfig } from 'astro/config'; import tailwind from '@astrojs/tailwind'; +import node from '@astrojs/node'; export default defineConfig({ srcDir: 'src', output: 'server', + adapter: node({ + mode: "standalone" + }), integrations: [ tailwind({ applyBaseStyles: true diff --git a/package.json b/package.json index 351dade..d40fb73 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,14 @@ "preview": "astro preview" }, "dependencies": { - "astro": "^4.0.0", + "@astrojs/node": "^9.5.1", + "astro": "^5.16.0", "js-yaml": "^4.1.0" }, "devDependencies": { "@astrojs/tailwind": "^5.0.0", - "tailwindcss": "^3.4.0", "autoprefixer": "^10.4.0", - "postcss": "^8.4.0" + "postcss": "^8.4.0", + "tailwindcss": "^3.4.0" } }