add docker setup
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
.env
|
||||
.git
|
||||
.gitignore
|
||||
.next
|
||||
README.md
|
||||
.dockerignore
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
FROM node:22.20.0 AS dependencies
|
||||
WORKDIR /no-copy-frontend
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
FROM node:22.20.0 AS builder
|
||||
WORKDIR /no-copy-frontend
|
||||
COPY . .
|
||||
COPY --from=dependencies /no-copy-frontend/node_modules ./node_modules
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22.20.0 AS runner
|
||||
WORKDIR /no-copy-frontend
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /no-copy-frontend/public ./public
|
||||
COPY --from=builder /no-copy-frontend/package.json ./package.json
|
||||
COPY --from=builder /no-copy-frontend/.next ./.next
|
||||
COPY --from=builder /no-copy-frontend/node_modules ./node_modules
|
||||
|
||||
EXPOSE 2999
|
||||
CMD ["npm", "start"]
|
||||
@@ -4,4 +4,9 @@
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Open [http://localhost:2999](http://localhost:2999)
|
||||
Open [http://localhost:2999](http://localhost:2999)
|
||||
|
||||
|
||||
## Docker
|
||||
|
||||
docker run -d -p 2998:2999 --name no-copy-frontend no-copy-frontend
|
||||
@@ -0,0 +1,23 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
frontend:
|
||||
container_name: no-copy-frontend
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "2998:2999"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=2999
|
||||
volumes:
|
||||
- ./public:/app/public
|
||||
- ./package.json:/app/package.json
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- no-copy-network
|
||||
|
||||
networks:
|
||||
no-copy-network:
|
||||
driver: bridge
|
||||
Generated
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "no-copy",
|
||||
"name": "no-copy-frontend",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "no-copy",
|
||||
"name": "no-copy-frontend",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "no-copy",
|
||||
"name": "no-copy-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user