File tree Expand file tree Collapse file tree 10 files changed +646
-37
lines changed
Expand file tree Collapse file tree 10 files changed +646
-37
lines changed Original file line number Diff line number Diff line change 1- name : FRONTEND-CI
2-
1+ name : client.yml
32on :
43 push :
54 branches :
65 - main
6+ - ' feature/**'
7+ paths :
8+ - ' client/**'
79 pull_request :
810 branches :
911 - main
12+ paths :
13+ - ' client/**'
1014
1115jobs :
12- build-test :
13- runs-on : ubuntu-latest
16+ build :
17+ runs-on : ubuntu-22.04
18+ defaults :
19+ run :
20+ working-directory : ./client
1421
1522 steps :
16- - name : Checkout repository
17- uses : actions/checkout@v4
23+ - uses : actions/checkout@v4
24+
25+ - name : DEBUG stage
26+ run : |
27+ pwd
28+ ls -la
29+ echo "Current branch: ${GITHUB_REF}"
1830
19- # Node(Dockerfile)
20- - name : Setup Node.js
31+ - name : Setup Nodejs
2132 uses : actions/setup-node@v4
2233 with :
23- node-version : 20
24- cache : npm
34+ node-version : ' 20'
35+ cache : ' npm'
36+ cache-dependency-path : ' client/package-lock.json'
37+
2538
2639 # Dependencies
2740 - name : Install dependencies
4255 # Production build
4356 - name : Build project
4457 run : npm run build
45-
46- docker-build :
47- runs-on : ubuntu-latest
48- needs : build-test
49-
50- steps :
51- - name : Checkout repository
52- uses : actions/checkout@v4
53-
54- # Docker
55- - name : Build Docker image
56- run : docker build -t lango-frontend .
Original file line number Diff line number Diff line change 1+ name : server.ci
2+ on :
3+ push :
4+ branches :
5+ - main
6+ - ' feature/**'
7+ paths :
8+ - ' server/**'
9+ - ' prisma/**'
10+ pull_request :
11+ branches :
12+ - main
13+ paths :
14+ - ' server/**'
15+ - ' prisma/**'
16+
17+
18+ jobs :
19+ build :
20+ runs-on : ubuntu-22.04
21+ defaults :
22+ run :
23+ working-directory : ./server
24+ env :
25+ DATABASE_URL : ${{ secrets.DATABASE_URL }}
26+ steps :
27+ - uses : actions/checkout@v4
28+ - name : DEBUG stage
29+ run : |
30+ pwd
31+ ls -la
32+ echo "Current branch: ${GITHUB_REF}"
33+
34+ - name : Setup Nodejs
35+ uses : actions/setup-node@v4
36+ with :
37+ node-version : ' 20'
38+ cache : ' npm'
39+ cache-dependency-path : ' server/package-lock.json'
40+
41+ - name : Install dependencies
42+ run : npm ci
43+
44+ - name : Prisma generate
45+ run : npx prisma generate
46+
47+ - name : Prisma validate
48+ run : npx prisma validate
49+
50+ - name : Build project
51+ run : npm run build
52+
53+
54+
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ COPY . .
1212RUN npm run build
1313
1414
15- FROM alpine:3.19
15+ FROM alpine:20-alpine
1616WORKDIR /app
1717COPY --from=builder /app/dist ./dist
1818
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ export const AsideMenu = memo((props: AsideMenuProps) => {
4040 }
4141 } , [ locale ] ) ;
4242
43+ //testt
44+
4345 return (
4446 < aside className = { clsx ( styles . aside , [ className ] ) } >
4547 < div >
Original file line number Diff line number Diff line change 11services :
22 postgres :
3- image : postgres:15 -alpine
3+ image : postgres:17 -alpine
44 container_name : postgres
55 restart : always
66 env_file :
77 - .env
8+ healthcheck :
9+ test : [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
10+ interval : 5s
11+ timeout : 5s
12+ retries : 5
813 volumes :
914 - postgres:/var/lib/postgresql/data
1015 networks :
@@ -22,7 +27,8 @@ services:
2227 ports :
2328 - ' 3001:3000'
2429 depends_on :
25- - postgres
30+ postgres :
31+ condition : service_healthy
2632 networks :
2733 - app-network
2834
Original file line number Diff line number Diff line change 11
2- FROM node:20 -alpine as builder
2+ FROM node:22 -alpine as builder
33
44WORKDIR /app
55
66COPY package*.json ./
7- COPY prisma ./prisma/
8-
9-
10- RUN npm ci && npx prisma generate
7+ RUN npm ci
118
129COPY . .
1310
11+ RUN npx prisma generate
12+
1413
1514RUN npm run build && npm cache clean --force
1615
17- FROM node:20 -alpine
16+ FROM node:22 -alpine
1817
1918WORKDIR /app
2019
20+ COPY --chown=node:node docker/entrypoint.sh ./entrypoint.sh
21+ RUN chmod +x ./entrypoint.sh
22+
2123COPY --from=builder --chown=node:node /app/node_modules ./node_modules
2224COPY --from=builder --chown=node:node /app/package*.json ./
2325COPY --from=builder --chown=node:node /app/dist ./dist
2426COPY --from=builder --chown=node:node /app/prisma ./prisma
2527
28+
29+ COPY --from=builder --chown=node:node /app/prisma.config.ts ./
30+
2631USER node
2732
2833EXPOSE 3000
2934
30- CMD ["sh" , "-c" , "npx prisma migrate deploy && node dist/src/main" ]
35+ ENTRYPOINT ["./entrypoint.sh" ]
36+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ echo " [DEBUG] Waiting for postgres (sleeping 5s)..."
5+ sleep 5
6+
7+ echo " [DEBUG] Start prisma migration"
8+ npx prisma migrate deploy
9+
10+ echo " [DEBUG] Starting application..."
11+ exec node dist/src/main.js
You can’t perform that action at this time.
0 commit comments