1
0
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:
2022-11-10 19:00:05 +07:00
parent 0a5c607387
commit d8e0c610ce
3 changed files with 42 additions and 2 deletions

15
.dockerignore Normal file
View 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
View File

@@ -5,8 +5,10 @@
# Temporary files
node_modules
tmp
*.log*
**/*~
**/*.log
**/.DS_Store
**/Thumbs.db
# Build
src/.nuxt

23
Dockerfile Normal file
View 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"]