diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a9469c0 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +POSTGRES_USER=dev_user +POSTGRES_PASSWORD=dev_password123 +POSTGRES_DB=dev_db diff --git a/docker-compose.coolify.yml b/docker-compose.coolify.yml new file mode 100644 index 0000000..276792b --- /dev/null +++ b/docker-compose.coolify.yml @@ -0,0 +1,26 @@ +services: + api: + image: node:26-alpine + working_dir: /app + command: sh -c "npm install -g pnpm && pnpm install && pnpm start:dev" + volumes: + - .:/app + - node_modules:/app/node_modules + environment: + PORT: ${PORT:-3000} + DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} + depends_on: + - postgres + + postgres: + image: postgres:18-alpine + environment: + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB} + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + node_modules: + postgres_data: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ac76ca7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +services: + api: + image: node:26-alpine + working_dir: /app + command: sh -c "npm install -g pnpm && pnpm install && pnpm start:dev" + ports: + - "${PORT:-3000}:${PORT:-3000}" + volumes: + - .:/app + - node_modules:/app/node_modules + environment: + PORT: ${PORT:-3000} + DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} + depends_on: + - postgres + + postgres: + image: postgres:18-alpine + environment: + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB} + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + node_modules: + postgres_data: \ No newline at end of file