local dev setup

This commit is contained in:
dimitar 2026-07-29 16:52:54 +02:00
parent c51ff09cdc
commit 6bb72dc97f
4 changed files with 60 additions and 1 deletions

14
Dockerfile.dev Normal file
View File

@ -0,0 +1,14 @@
FROM node:20-alpine
RUN apk add --no-cache openssl
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
EXPOSE 3000
CMD ["/bin/sh", "/app/scripts/start-dev.sh"]

39
docker-compose.dev.yaml Normal file
View File

@ -0,0 +1,39 @@
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: monuments
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile.dev
restart: unless-stopped
env_file:
- .env
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/monuments
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
- /app/.next
depends_on:
db:
condition: service_healthy
volumes:
pgdata:

1
package-lock.json generated
View File

@ -7,7 +7,6 @@
"": {
"name": "spomeniqr",
"version": "0.1.0",
"hasInstallScript": true,
"dependencies": {
"@aws-sdk/client-s3": "^3.1073.0",
"@aws-sdk/s3-request-presigner": "^3.1073.0",

7
scripts/start-dev.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -e
npx prisma generate
npx prisma migrate deploy
npm run dev