mirror of
https://github.com/robonen/canvas-3d.git
synced 2026-03-20 02:44:40 +00:00
feat(repo): dockerfile
This commit is contained in:
15
.dockerignore
Normal file
15
.dockerignore
Normal file
@@ -0,0 +1,15 @@
|
||||
# Ignore everything
|
||||
*
|
||||
|
||||
# Allow files and directories
|
||||
!src
|
||||
!nuxt.config.ts
|
||||
!tsconfig.json
|
||||
!package.json
|
||||
!package-lock.json
|
||||
|
||||
# Ignore unnecessary files inside allowed directories
|
||||
**/*~
|
||||
**/*.log
|
||||
**/.DS_Store
|
||||
**/Thumbs.db
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -5,8 +5,10 @@
|
||||
|
||||
# Temporary files
|
||||
node_modules
|
||||
tmp
|
||||
*.log*
|
||||
**/*~
|
||||
**/*.log
|
||||
**/.DS_Store
|
||||
**/Thumbs.db
|
||||
|
||||
# Build
|
||||
src/.nuxt
|
||||
|
||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
ARG NODE_VERSION=18.12-slim
|
||||
|
||||
# Stage 1: Build the application
|
||||
FROM node:${NODE_VERSION} AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# See .dockerignore
|
||||
COPY . .
|
||||
|
||||
RUN npm ci && npm cache clean --force && ls -a
|
||||
|
||||
# Stage 2: Run the application
|
||||
FROM node:${NODE_VERSION}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /build/src/.output .
|
||||
|
||||
VOLUME /app
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "./server/index.mjs"]
|
||||
Reference in New Issue
Block a user