add docker files

This commit is contained in:
sk1982 2024-04-07 03:59:11 -04:00
parent 8f61811cd2
commit 41245c42de
4 changed files with 56 additions and 0 deletions

11
.dockerignore Normal file
View File

@ -0,0 +1,11 @@
Dockerfile
.dockerignore
node_modules
public/assets/*
!public/assets/fonts
.next
.git
scripts
.idea
npm-debug.log
README.md

28
Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM node:21 AS base
FROM base AS deps
WORKDIR /app
COPY package*.json .
RUN npm ci
FROM base AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN npm run build
RUN node compress.mjs
RUN chown -R nextjs:nodejs .next
USER nextjs
EXPOSE 3000
ENV PORT 3000
CMD HOSTNAME="0.0.0.0" npm run start

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
services:
actaeon:
container_name: actaeon
build:
dockerfile: ./Dockerfile
environment:
- AUTOMIGRATE=true
- DATABASE_URL=mysql://aime:aime@127.0.0.1:3306/aime
- NEXTAUTH_SECRET=[insert_random_string_here]
ports:
- 3000:1430

View File

@ -0,0 +1,6 @@
#!/bin/sh
rm -rf .next
mkdir .next
docker container cp actaeon:/app/.next/static/ .next/