init
All checks were successful
Build and Release / release (push) Successful in 39s

This commit is contained in:
2026-04-20 09:40:59 +07:00
parent 2508172489
commit 780bb9609a
4 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
name: Build and Release
run-name: ${{ gitea.actor }} build 🚀
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create .env file
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- name: Deploy to Container
run: |
docker compose up -d --build --remove-orphans

38
Dockerfile Normal file
View File

@@ -0,0 +1,38 @@
FROM node:24-alpine AS base
# Stage 1: Dependencies Installation
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
# Stage 2: Application Build
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
COPY .env .env
RUN npm run build
# Stage 3: Production Runner
FROM node:24-alpine AS runner
WORKDIR /app
# copy env runtime
COPY --from=builder /app/.env .env
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
USER node
EXPOSE 3000
CMD ["node", "server.js"]

15
docker-compose.yml Normal file
View File

@@ -0,0 +1,15 @@
services:
history-client:
build:
context: .
dockerfile: Dockerfile
container_name: history-client
restart: unless-stopped
ports:
- "3013:3000"
networks:
- history-client-network
networks:
history-client-network:
driver: bridge

View File

@@ -2,6 +2,7 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
output: 'standalone'
};
export default nextConfig;