mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
revert to use yarn
This commit is contained in:
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@@ -13,18 +13,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
node-version: 20
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Run tests
|
||||
run: pnpm test
|
||||
- run: yarn install
|
||||
- run: yarn test
|
||||
|
||||
70
Dockerfile
70
Dockerfile
@@ -1,41 +1,49 @@
|
||||
FROM node:22 AS builder
|
||||
FROM node:22
|
||||
|
||||
# Install chromium dependencies in a separate layer (cacheable)
|
||||
RUN apt-get update && apt-get install -y chromium && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /fredy
|
||||
|
||||
RUN corepack enable \
|
||||
&& corepack prepare pnpm@latest --activate
|
||||
# Copy only package.json + yarn.lock for dependency caching
|
||||
COPY package.json yarn.lock ./
|
||||
COPY . /fredy
|
||||
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
RUN pnpm run prod
|
||||
|
||||
FROM node:22-slim
|
||||
|
||||
WORKDIR /fredy
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y chromium \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN corepack enable \
|
||||
&& corepack prepare pnpm@latest --activate \
|
||||
&& pnpm add -g pm2
|
||||
|
||||
COPY --from=builder /fredy/node_modules ./node_modules
|
||||
COPY --from=builder /fredy/dist ./dist
|
||||
COPY --from=builder /fredy/package.json ./
|
||||
RUN apt-get update && apt-get install -y chromium
|
||||
|
||||
# Increase network timeout for npm registry
|
||||
RUN yarn config set network-timeout 600000 && yarn install
|
||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
||||
|
||||
RUN mkdir -p /db /conf \
|
||||
&& chown 1000:1000 /db /conf \
|
||||
&& chmod 777 /db /conf \
|
||||
&& ln -s /db /fredy/db \
|
||||
&& ln -s /conf /fredy/conf
|
||||
# Global tools (cached separately)
|
||||
# Timeout fix für yarn hinzugefügt
|
||||
RUN yarn config set network-timeout 600000
|
||||
|
||||
RUN yarn install
|
||||
|
||||
RUN yarn global add pm2
|
||||
|
||||
# Copy application source code (after deps, cache friendly)
|
||||
COPY . .
|
||||
|
||||
# Build step (assuming 'prod' is a build script)
|
||||
RUN yarn run prod
|
||||
|
||||
# Prepare runtime dirs
|
||||
RUN mkdir /db /conf && \
|
||||
chown 1000:1000 /db /conf && \
|
||||
chmod 777 -R /db/ && \
|
||||
ln -s /db /fredy/db && ln -s /conf /fredy/conf
|
||||
chown 1000:1000 /db /conf && \
|
||||
chmod 777 -R /db/ && \
|
||||
ln -s /db /fredy/db && ln -s /conf /fredy/conf
|
||||
|
||||
# Expose port & set runtime command
|
||||
EXPOSE 9998
|
||||
CMD ["pm2-runtime", "index.js"]
|
||||
|
||||
CMD pm2-runtime index.js
|
||||
|
||||
CMD ["pm2-runtime", "dist/index.js"]
|
||||
|
||||
13
README.md
13
README.md
@@ -25,10 +25,9 @@ If you want to try out _Fredy_, you can access the demo version [here](https://f
|
||||
- Make sure to use Node.js 22 or above
|
||||
- Run the following commands:
|
||||
```ssh
|
||||
npm install -g pnpm //if you have not yet installed pnpm
|
||||
pnpm i
|
||||
pnpm prod
|
||||
pnpm start
|
||||
yarn (or npm install)
|
||||
yarn run prod
|
||||
yarn run start
|
||||
```
|
||||
_Fredy_ will start with the default port, set to `9998`. You can access _Fredy_ by opening your browser at `http://localhost:9998`. The default login is `admin`, both for username and password. You should change the password as soon as possible when you plan to run Fredy on a server.
|
||||
|
||||
@@ -67,18 +66,18 @@ As an administrator, you can create, edit and remove users from _Fredy_. Be care
|
||||
To run _Fredy_ in development mode, you need to run the backend & frontend separately.
|
||||
Start the backend with:
|
||||
```shell
|
||||
pnpm start
|
||||
yarn run start
|
||||
```
|
||||
For the frontend, run:
|
||||
```shell
|
||||
pnpm dev
|
||||
yarn run dev
|
||||
```
|
||||
You should now be able to access _Fredy_ from your browser. Check your Terminal to see what port the frontend is running on.
|
||||
|
||||
### Running Tests
|
||||
To run the tests, run
|
||||
```shell
|
||||
pnpm test
|
||||
yarn run test
|
||||
```
|
||||
|
||||
# Architecture
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
"name": "fredy",
|
||||
"version": "12.0.0",
|
||||
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
|
||||
"packageManager": "pnpm@9.1.0",
|
||||
"scripts": {
|
||||
"start": "node prod.js",
|
||||
"dev": "pnpm install && rm -rf ./ui/public/* && vite",
|
||||
"dev": "yarn && rm -rf ./ui/public/* && vite",
|
||||
"ui": "rm -rf ./ui/public/* && vite",
|
||||
"prod": "pnpm install && vite build --emptyOutDir",
|
||||
"prod": "yarn && vite build --emptyOutDir",
|
||||
"format": "prettier --write lib/**/*.js ui/src/**/*.jsx test/**/*.js *.js --single-quote --print-width 120",
|
||||
"test": "mocha --loader=esmock --timeout 3000000 test/**/*.test.js",
|
||||
"lint": "eslint ./index.js ./lib/**/*.js ./test/**/*.js ./ui/src/**/*.jsx"
|
||||
@@ -41,8 +40,8 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=22.0.0",
|
||||
"pnpm": ">=9.0.0"
|
||||
"node": ">=20.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 0.5%",
|
||||
|
||||
8642
pnpm-lock.yaml
generated
8642
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user