added docker file

This commit is contained in:
JBB0807 2025-04-28 09:53:22 -07:00
parent 8c5fe4266f
commit a94f4df283
17 changed files with 931 additions and 9 deletions

View file

@ -0,0 +1,40 @@
# Node.js specific
**node_modules/
npm-debug.log
yarn-debug.log
# Environment and secrets
.env*
*.env
*.pem
*.key
*.crt
# Development artifacts
.idea/
.vscode/
*.swp
*.swo
dist/
build/
out/
# Version control
.git/
.gitignore
# Temporary files
tmp/
temp/
*.tmp
# Documentation
*.md
README*
# Docker files
Dockerfile*
docker-compose*
# Project-specific
package-lock.json

View file

@ -0,0 +1,29 @@
# syntax=docker/dockerfile:1
# Use the official Node.js image as the base image
ARG NODE_VERSION=22.13.1
FROM node:${NODE_VERSION}-slim AS base
# Set the working directory
WORKDIR /app
# Then copy the rest of the application code
COPY . .
# Install build tools (needed for bcrypt native bindings)
RUN apt-get update -y && apt-get install -y build-essential python3 openssl
# Copy only package files first (faster caching)
COPY package*.json ./
# Install dependencies
RUN npm install && npx prisma generate
# Rebuild bcrypt specifically (optional if clean install is guaranteed)
RUN npm rebuild bcrypt --build-from-source
# Expose the application port
EXPOSE 3200
# Start the application
CMD ["node", "app.js"]

View file

@ -0,0 +1,12 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
#use this when testing local, remmber to run the proxy command
DATABASE_URL="postgresql://postgres:wly9H8gjjmxYfg1@localhost:15432/postgres?schema=public"
# DATABASE_URL="postgres://postgres:wly9H8gjjmxYfg1@bytecamp-db.flycast:5432?sslmode=disable"
# DATABASE_URL=postgres://snakebyte:zVB7lgOiKr89dq6@localhost:5432/snakebyte?sslmode=disable
NODE_PORT=3000