Docker push

This commit is contained in:
Ryan 2025-04-08 13:19:40 +10:00
commit 80ab340832
2 changed files with 39 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
# Use an official Node.js image as the base
FROM node:16-alpine AS base
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm install
# Copy code and build for production
FROM base AS production
COPY . .
RUN npm run build
EXPOSE 9000
CMD ["npm", "start"]

25
docker-compose.yml Normal file
View File

@ -0,0 +1,25 @@
version: "3.8"
services:
app:
build:
context: .
dockerfile: Dockerfile
target: production # Optional: use if your Dockerfile defines multiple stages
environment:
# Define your app-specific environment variables
DATABASE_URL: postgres://user:pass@db:5432/app
# Do not define "ports" here—Coolify will handle them for you
depends_on:
- db
db:
image: postgres:13
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: app
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data: