Skip to content

Commit

Permalink
Dockerfile Components
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodcloak committed Mar 25, 2024
1 parent 68ee6ad commit 930d6c9
Show file tree
Hide file tree
Showing 5 changed files with 810 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Git
.git
.gitignore

# Meta Files
LICENSE
Dockerfile

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# TypeScript Output
build/**/*

# VSCode
.vscode
tsconfig.tsbuildinfo

# Environment Variables
*.env
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# CRLF Normalisation
* text=auto

# Ignore meta files in ZIP export
.gitattributes export-ignore
.gitignore export-ignore

# Never merge Lockfiles
package-lock.json -diff
yarn.lock -diff
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
.env
*.lock
.env
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Alpine Node Image
FROM node:21-alpine
ENV NODE_ENV=production

# Create app directory
WORKDIR /usr/app

# Install prod dependencies
COPY package.json yarn.lock ./

# Build
COPY . .
RUN yarn install --immutable && \
yarn cache clean && \
yarn cache clean --mirror
RUN yarn migrate

# Repo Metadata
ARG GIT_REPO
ARG GIT_VERSION
LABEL org.opencontainers.image.source=${GIT_REPO}
ENV GIT_VERSION=${GIT_VERSION}

# Start Bot
CMD ["yarn", "start"]
Loading

0 comments on commit 930d6c9

Please sign in to comment.