File tree Expand file tree Collapse file tree 6 files changed +102
-42
lines changed
Expand file tree Collapse file tree 6 files changed +102
-42
lines changed Original file line number Diff line number Diff line change 8484DATABASES = {
8585 "default" : {
8686 "ENGINE" : "django.db.backends.postgresql" ,
87- "HOST" : os .environ .get ("DB_HOST" ),
88- "NAME" : os .environ .get ("DB_NAME" ),
89- "USER" : os .environ .get ("DB_USER" ),
90- "PASSWORD" : os .environ .get ("DB_PASS" ),
87+ "HOST" : os .environ .get ("DB_HOST" , "db" ),
88+ "PORT" : int (os .environ .get ("DB_PORT" , "5432" )),
89+ "NAME" : os .environ .get ("DB_NAME" , "dev_db" ),
90+ "USER" : os .environ .get ("DB_USER" , "devuser" ),
91+ "PASSWORD" : os .environ .get ("DB_PASS" , "changeme" ),
92+ "OPTIONS" : {"connect_timeout" : 5 },
9193 }
9294}
9395
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ services :
2+ backend :
3+ build : { context: ./backend, args: [DEV=true] }
4+ working_dir : /app
5+ command : >
6+ sh -c "python app/manage.py wait_for_db &&
7+ python app/manage.py migrate &&
8+ python app/manage.py runserver 0.0.0.0:8000"
9+ ports : ["8000:8000"]
10+ volumes : ["./backend:/app"]
11+ env_file : ["./backend/.env"]
12+ depends_on :
13+ db : { condition: service_healthy }
14+ redis : { condition: service_healthy }
15+
16+ frontend :
17+ build :
18+ context : ./frontend
19+ target : dev
20+ ports : ["3000:3000"]
21+ environment :
22+ - NUXT_PUBLIC_API_BASE=http://localhost:8000
23+ volumes :
24+ - ./frontend:/app
25+ - /app/node_modules
26+ depends_on :
27+ backend :
28+ condition : service_started
29+
30+
31+ db :
32+ image : postgres:15-alpine
33+ environment :
34+ - POSTGRES_DB=dev_db
35+ - POSTGRES_USER=devuser
36+ - POSTGRES_PASSWORD=changeme
37+ volumes : ["dev-db-data:/var/lib/postgresql/data"]
38+ healthcheck :
39+ test : ["CMD-SHELL","pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB} -h 127.0.0.1"]
40+ interval : 5s
41+ timeout : 3s
42+ retries : 10
43+
44+ redis :
45+ image : redis:7-alpine
46+ healthcheck :
47+ test : ["CMD","redis-cli","ping"]
48+ interval : 3s
49+ timeout : 2s
50+ retries : 20
51+
52+ volumes :
53+ dev-db-data :
Original file line number Diff line number Diff line change 1+ node_modules
2+ .git
3+ .env
4+ .nuxt
5+ .output
6+ dist
7+ coverage
Original file line number Diff line number Diff line change 1+ # --- Base ---
2+ FROM node:22-alpine AS base
3+
4+ WORKDIR /app
5+ RUN apk add --no-cache libc6-compat
6+
7+ # --- Deps (cache) ---
8+ FROM base AS deps
9+ COPY package.json package-lock.json* ./
10+ RUN --mount=type=cache,target=/root/.npm npm ci
11+
12+ # --- Dev target ---
13+ FROM base AS dev
14+ ENV NUXT_HOST=0.0.0.0 NUXT_PORT=3000
15+ COPY --from=deps /app/node_modules ./node_modules
16+ COPY . .
17+ EXPOSE 3000
18+ CMD ["npm" ,"run" ,"dev" ]
19+
20+ # --- Build (prod) ---
21+ FROM base AS build
22+ ENV NODE_ENV=production
23+ COPY --from=deps /app/node_modules ./node_modules
24+ COPY . .
25+ RUN npm run build
26+
27+ # --- Runtime (prod) ---
28+ FROM node:22-alpine AS prod
29+ WORKDIR /app
30+ ENV NODE_ENV=production
31+ # Nuxt Nitro node-server output
32+ ENV PORT=3000 NITRO_PORT=3000 NUXT_HOST=0.0.0.0
33+ COPY --from=build /app/.output ./.output
34+ EXPOSE 3000
35+ CMD ["node" ,".output/server/index.mjs" ]
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export default defineNuxtConfig({
2222 "/ws/**" : { proxy : "http://127.0.0.1:8000/ws/**" } ,
2323 } ,
2424 } ,
25+
2526 modules : [
2627 "@nuxt/content" ,
2728 "@nuxt/eslint" ,
You can’t perform that action at this time.
0 commit comments