Docker push
This commit is contained in:
commit
80ab340832
14
Dockerfile
Normal file
14
Dockerfile
Normal 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
25
docker-compose.yml
Normal 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:
|
||||
Loading…
x
Reference in New Issue
Block a user