Skip to content

Commit 40f9078

Browse files
authored
Merge branch 'main' into server/auth
2 parents 5400b78 + 63b2263 commit 40f9078

File tree

10 files changed

+646
-37
lines changed

10 files changed

+646
-37
lines changed
Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,40 @@
1-
name: FRONTEND-CI
2-
1+
name: client.yml
32
on:
43
push:
54
branches:
65
- main
6+
- 'feature/**'
7+
paths:
8+
- 'client/**'
79
pull_request:
810
branches:
911
- main
12+
paths:
13+
- 'client/**'
1014

1115
jobs:
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
@@ -42,15 +55,3 @@ jobs:
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 .

.github/workflows/server.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+

client/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ COPY . .
1212
RUN npm run build
1313

1414

15-
FROM alpine:3.19
15+
FROM alpine:20-alpine
1616
WORKDIR /app
1717
COPY --from=builder /app/dist ./dist
1818

client/src/widgets/AsideMenu/ui/AsideMenu/AsideMenu.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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>

infra/docker-compose.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
services:
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

server/Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11

2-
FROM node:20-alpine as builder
2+
FROM node:22-alpine as builder
33

44
WORKDIR /app
55

66
COPY package*.json ./
7-
COPY prisma ./prisma/
8-
9-
10-
RUN npm ci && npx prisma generate
7+
RUN npm ci
118

129
COPY . .
1310

11+
RUN npx prisma generate
12+
1413

1514
RUN npm run build && npm cache clean --force
1615

17-
FROM node:20-alpine
16+
FROM node:22-alpine
1817

1918
WORKDIR /app
2019

20+
COPY --chown=node:node docker/entrypoint.sh ./entrypoint.sh
21+
RUN chmod +x ./entrypoint.sh
22+
2123
COPY --from=builder --chown=node:node /app/node_modules ./node_modules
2224
COPY --from=builder --chown=node:node /app/package*.json ./
2325
COPY --from=builder --chown=node:node /app/dist ./dist
2426
COPY --from=builder --chown=node:node /app/prisma ./prisma
2527

28+
29+
COPY --from=builder --chown=node:node /app/prisma.config.ts ./
30+
2631
USER node
2732

2833
EXPOSE 3000
2934

30-
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/src/main"]
35+
ENTRYPOINT ["./entrypoint.sh"]
36+

server/docker/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

0 commit comments

Comments
 (0)