add docker setting
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
node_modules
|
||||||
|
.env
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.next
|
||||||
|
README.md
|
||||||
|
.dockerignore
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
FROM node:22.20.0 AS dependencies
|
||||||
|
WORKDIR /no-copy-legal-panel-frontend
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
FROM node:22.20.0 AS builder
|
||||||
|
WORKDIR /no-copy-legal-panel-frontend
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
COPY --from=dependencies /no-copy-legal-panel-frontend/node_modules ./node_modules
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:22.20.0 AS runner
|
||||||
|
WORKDIR /no-copy-legal-panel-frontend
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
COPY --from=builder /no-copy-legal-panel-frontend/public ./public
|
||||||
|
COPY --from=builder /no-copy-legal-panel-frontend/package.json ./package.json
|
||||||
|
COPY --from=builder /no-copy-legal-panel-frontend/.next ./.next
|
||||||
|
COPY --from=builder /no-copy-legal-panel-frontend/node_modules ./node_modules
|
||||||
|
|
||||||
|
EXPOSE 2999
|
||||||
|
CMD ["npm", "start"]
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
frontend:
|
||||||
|
container_name: no-copy-legal-panel-frontend
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "2997:2997"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- PORT=2997
|
||||||
|
- DOCKER_ENV=true
|
||||||
|
volumes:
|
||||||
|
- ./public:/app/public
|
||||||
|
- ./package.json:/app/package.json
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
app-network:
|
||||||
|
external: true
|
||||||
|
name: app-network
|
||||||
+2
-2
@@ -4,8 +4,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build -p 2997",
|
||||||
"start": "next start"
|
"start": "next start -p 2997"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "16.1.2",
|
"next": "16.1.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user