mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-31 08:04:54 +02:00
Add docker file for dev
This commit is contained in:
parent
f9798a8d86
commit
75e01018a5
4 changed files with 101 additions and 19 deletions
14
Dockerfile.dev
Normal file
14
Dockerfile.dev
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Use tsx watch for development with hot reload
|
||||||
|
CMD ["npm", "run", "dev"]
|
|
@ -1,19 +0,0 @@
|
||||||
services:
|
|
||||||
# PostgreSQL Service
|
|
||||||
db:
|
|
||||||
image: postgres:17 # Use the PostgreSQL 17 image
|
|
||||||
container_name: dev_postgres # Name your PostgreSQL container
|
|
||||||
environment:
|
|
||||||
POSTGRES_DB: postgres # Default database name
|
|
||||||
POSTGRES_USER: postgres # Default user
|
|
||||||
POSTGRES_PASSWORD: password # Default password (change for production!)
|
|
||||||
ports:
|
|
||||||
- "5432:5432" # Map host port 5432 to container port 5432
|
|
||||||
restart: no
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:latest # Use the latest Redis image
|
|
||||||
container_name: dev_redis # Name your Redis container
|
|
||||||
ports:
|
|
||||||
- "6379:6379" # Map host port 6379 to container port 6379
|
|
||||||
restart: no
|
|
55
docker-compose.pgr.yml
Normal file
55
docker-compose.pgr.yml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
services:
|
||||||
|
# PostgreSQL Service
|
||||||
|
db:
|
||||||
|
image: postgres:17 # Use the PostgreSQL 17 image
|
||||||
|
container_name: dev_postgres # Name your PostgreSQL container
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: postgres # Default database name
|
||||||
|
POSTGRES_USER: postgres # Default user
|
||||||
|
POSTGRES_PASSWORD: password # Default password (change for production!)
|
||||||
|
ports:
|
||||||
|
- "5432:5432" # Map host port 5432 to container port 5432
|
||||||
|
restart: no
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:latest # Use the latest Redis image
|
||||||
|
container_name: dev_redis # Name your Redis container
|
||||||
|
ports:
|
||||||
|
- "6379:6379" # Map host port 6379 to container port 6379
|
||||||
|
restart: no
|
||||||
|
|
||||||
|
# Development application service
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
container_name: dev_pangolin
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=development
|
||||||
|
- ENVIRONMENT=dev
|
||||||
|
- DB_TYPE=pg
|
||||||
|
- DATABASE_URL=postgresql://postgres:password@db:5432/postgres
|
||||||
|
- REDIS_URL=redis://redis:6379
|
||||||
|
volumes:
|
||||||
|
# Mount source code for hot reload
|
||||||
|
- ./src:/app/src
|
||||||
|
- ./server:/app/server
|
||||||
|
- ./public:/app/public
|
||||||
|
- ./messages:/app/messages
|
||||||
|
- ./components.json:/app/components.json
|
||||||
|
- ./next.config.mjs:/app/next.config.mjs
|
||||||
|
- ./tsconfig.json:/app/tsconfig.json
|
||||||
|
- ./tailwind.config.js:/app/tailwind.config.js
|
||||||
|
- ./postcss.config.mjs:/app/postcss.config.mjs
|
||||||
|
- ./eslint.config.js:/app/eslint.config.js
|
||||||
|
# Use named volume for node_modules to avoid platform-specific issues
|
||||||
|
- node_modules:/app/node_modules
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
restart: no
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
node_modules:
|
32
docker-compose.yml
Normal file
32
docker-compose.yml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
services:
|
||||||
|
# Development application service
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
container_name: dev_pangolin
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
- "3001:3001"
|
||||||
|
- "3002:3002"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=development
|
||||||
|
- ENVIRONMENT=dev
|
||||||
|
- DB_TYPE=pg
|
||||||
|
volumes:
|
||||||
|
# Mount source code for hot reload
|
||||||
|
- ./src:/app/src
|
||||||
|
- ./server:/app/server
|
||||||
|
- ./public:/app/public
|
||||||
|
- ./messages:/app/messages
|
||||||
|
- ./components.json:/app/components.json
|
||||||
|
- ./next.config.mjs:/app/next.config.mjs
|
||||||
|
- ./tsconfig.json:/app/tsconfig.json
|
||||||
|
- ./tailwind.config.js:/app/tailwind.config.js
|
||||||
|
- ./postcss.config.mjs:/app/postcss.config.mjs
|
||||||
|
- ./eslint.config.js:/app/eslint.config.js
|
||||||
|
- ./config:/app/config
|
||||||
|
restart: no
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
node_modules:
|
Loading…
Add table
Add a link
Reference in a new issue