commit 80ab340832d870d216ccba8b8dcadd6d6c7ec4a8 Author: Ryan Date: Tue Apr 8 13:19:40 2025 +1000 Docker push diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b309539 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ccab663 --- /dev/null +++ b/docker-compose.yml @@ -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: