forked from sk1982/actaeon
add docker files
This commit is contained in:
parent
8f61811cd2
commit
41245c42de
11
.dockerignore
Normal file
11
.dockerignore
Normal 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
28
Dockerfile
Normal 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
11
docker-compose.yml
Normal 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
|
6
docker-transfer-next-static.sh
Normal file
6
docker-transfer-next-static.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -rf .next
|
||||
mkdir .next
|
||||
|
||||
docker container cp actaeon:/app/.next/static/ .next/
|
Loading…
Reference in New Issue
Block a user