Compare commits
No commits in common. "0c2e34bb6130ebf2917f95288d38196cc26fa87b" and "58ebf72d9a40da3cf83be6c5f18156d4de6239cc" have entirely different histories.
0c2e34bb61
...
58ebf72d9a
4 changed files with 15 additions and 51 deletions
|
|
@ -1,21 +0,0 @@
|
||||||
name: Deploy SvelteKit
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: self-hosted
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Deploy with Docker
|
|
||||||
run: |
|
|
||||||
docker compose down
|
|
||||||
docker compose build
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
27
Dockerfile
27
Dockerfile
|
|
@ -1,28 +1,19 @@
|
||||||
# Builder stage
|
# Use a Node.js Alpine image for the builder stage
|
||||||
FROM node:22-alpine AS builder
|
FROM node:22-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
# Install deps for build
|
|
||||||
COPY package*.json .
|
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
# Copy source and build
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
# Final image
|
|
||||||
FROM node:22-alpine
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy only what's needed for runtime
|
|
||||||
COPY package.json ./
|
|
||||||
COPY --from=builder /app/build ./build/
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules/
|
|
||||||
|
|
||||||
# Prune dev dependencies
|
|
||||||
RUN npm prune --production
|
RUN npm prune --production
|
||||||
|
|
||||||
|
# Use another Node.js Alpine image for the final stage
|
||||||
|
FROM node:22-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/build build/
|
||||||
|
COPY --from=builder /app/node_modules node_modules/
|
||||||
|
COPY package.json .
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
CMD [ "node", "build" ]
|
CMD [ "node", "build" ]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
client:
|
|
||||||
build: .
|
|
||||||
container_name: client
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
environment:
|
|
||||||
NODE_ENV: production
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
<script module>
|
||||||
|
/* Types */
|
||||||
|
type t = string;
|
||||||
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Article from '$lib/components/Article.svelte';
|
import Article from '$lib/components/Article.svelte';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue