Skip to content

Commit 4c76333

Browse files
authored
fix(server): fix prisma bin engine error in amd64 (#547)
1 parent 3282894 commit 4c76333

File tree

10 files changed

+44
-69
lines changed

10 files changed

+44
-69
lines changed

.github/workflows/dockerize-server.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ jobs:
2323
with:
2424
fetch-depth: 0
2525

26-
- name: Use Node
27-
uses: actions/setup-node@v3
28-
with:
29-
node-version: 18.x
26+
# - name: Use Node
27+
# uses: actions/setup-node@v3
28+
# with:
29+
# node-version: 18.x
3030

31-
- name: Install Package
32-
working-directory: server
33-
run: npm cache clean --force && npm install
31+
# - name: Install Package
32+
# working-directory: server
33+
# run: npm cache clean --force && npm install
3434

35-
- name: Build Server
36-
working-directory: server
37-
run: npm run build
35+
# - name: Build Server
36+
# working-directory: server
37+
# run: npm run build
3838

3939
- name: Docker meta
4040
id: meta

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"sealctl",
7878
"sealos",
7979
"signin",
80+
"statefulset",
8081
"storageclass",
8182
"tolerations",
8283
"uids",

core/controllers/database/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ WORKDIR /
66

77
USER 65532:65532
88

9-
COPy bin/manager-$TARGETARCH /manager
9+
COPY bin/manager-$TARGETARCH /manager
1010

1111
ENTRYPOINT ["/manager"]

core/controllers/gateway/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ WORKDIR /
66

77
USER 65532:65532
88

9-
COPy bin/manager-$TARGETARCH /manager
9+
COPY bin/manager-$TARGETARCH /manager
1010

1111
ENTRYPOINT ["/manager"]

core/controllers/oss/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ WORKDIR /
66

77
USER 65532:65532
88

9-
COPy bin/manager-$TARGETARCH /manager
9+
COPY bin/manager-$TARGETARCH /manager
1010

1111
ENTRYPOINT ["/manager"]

server/.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# node_modules
1+
dist
2+
node_modules
23
.env.local
34
.env

server/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ FROM node:18-slim
33
RUN apt-get update
44
RUN apt-get install -y openssl
55

6+
ARG TARGETARCH
7+
68
WORKDIR /app
79

810
EXPOSE 3000
911

1012
COPY . /app
1113

12-
# RUN npm install
13-
# RUN npx prisma generate
14-
# RUN npm run build
14+
RUN npm install
15+
RUN npm run build
1516

1617
CMD [ "node", "dist/main" ]

server/Dockerfile.alpine

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# @see https://github.com/prisma/prisma/issues/8478#issuecomment-1095544159
22
FROM positivly/prisma-binaries:latest as prisma
33

4-
FROM node:18-alpine
5-
RUN apk add --no-cache openssl
4+
FROM node:18-slim
5+
6+
RUN apt-get update
7+
RUN apt-get install -y openssl
68

79
## Your normal build steps here
810

@@ -18,10 +20,8 @@ COPY --from=prisma /prisma-engines/query-engine /prisma-engines/migration-engine
1820

1921
EXPOSE 3000
2022
WORKDIR /app
21-
ENV LOG_LEVEL=debug
2223
COPY . /app
2324
RUN npm install
2425
RUN npx prisma generate --schema ./prisma/schema.prisma
2526
RUN npm run build
26-
USER node
2727
CMD [ "node", "dist/main" ]

server/README.md

+18-47
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
1-
<p align="center">
2-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
3-
</p>
41

5-
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6-
[circleci-url]: https://circleci.com/gh/nestjs/nest
7-
8-
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9-
<p align="center">
10-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13-
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14-
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
15-
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
16-
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
17-
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
18-
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
19-
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
20-
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
21-
</p>
22-
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
23-
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
242

253
## Description
264

@@ -29,20 +7,27 @@
297
## Installation
308

319
```bash
32-
$ npm install
10+
npm install
11+
npx prisma generate
12+
npx prisma db push
3313
```
3414

35-
## Running the app
15+
## Debug the app
3616

3717
```bash
38-
# development
39-
$ npm run start
40-
41-
# watch mode
42-
$ npm run start:dev
43-
44-
# production mode
45-
$ npm run start:prod
18+
# Forward service in cluster to localhost, run this command in another terminal separately
19+
kubectl port-forward deployment/mongodb 27017:27017 -n laf-system
20+
kubectl port-forward statefulset/laf-minio 9000:9000 -n laf-system
21+
kubectl port-forward deployments/casdoor 30070:8000 -n laf-system
22+
23+
# Run these in first time or when someone change the schema.
24+
cd server
25+
npm install
26+
npx prisma db push
27+
npx prisma generate
28+
29+
# run dev
30+
npm run watch
4631
```
4732

4833
## Test
@@ -56,18 +41,4 @@ $ npm run test:e2e
5641

5742
# test coverage
5843
$ npm run test:cov
59-
```
60-
61-
## Support
62-
63-
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
64-
65-
## Stay in touch
66-
67-
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
68-
- Website - [https://nestjs.com](https://nestjs.com/)
69-
- Twitter - [@nestframework](https://twitter.com/nestframework)
70-
71-
## License
72-
73-
Nest is [MIT licensed](LICENSE).
44+
```

server/prisma/schema.prisma

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
generator client {
55
provider = "prisma-client-js"
66
// previewFeatures = ["interactiveTransactions"]
7-
binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
7+
// binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
8+
binaryTargets = ["native"]
89
}
910

1011
datasource db {

0 commit comments

Comments
 (0)