Fixed infinite data fetching bug on homescreen. Docker files

This commit is contained in:
unknown 2021-06-14 12:13:38 +02:00
parent ff1d11f512
commit ad5e7646c1
4 changed files with 37 additions and 2 deletions

24
Dockerfile.multiarch Normal file
View file

@ -0,0 +1,24 @@
FROM node:14-alpine
WORKDIR /app
COPY package*.json ./
RUN apk --no-cache --virtual build-dependencies add python make g++ \
&& npm install --production
COPY . .
RUN mkdir -p ./public ./data \
&& cd ./client \
&& npm run build \
&& cd .. \
&& mv ./client/build/* ./public \
&& rm -rf ./client \
&& apk del build-dependencies
EXPOSE 5005
ENV NODE_ENV=production
CMD ["node", "server.js"]

View file

@ -2,6 +2,7 @@
[![JS Badge](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://shields.io/) [![JS Badge](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://shields.io/)
[![TS Badge](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://shields.io/) [![TS Badge](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://shields.io/)
[![Node Badge](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://shields.io/)
[![React Badge](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://shields.io/) [![React Badge](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://shields.io/)
![Homescreen screenshot](./github/_home.png) ![Homescreen screenshot](./github/_home.png)

View file

@ -59,14 +59,14 @@ const Home = (props: ComponentProps): JSX.Element => {
if (apps.length === 0) { if (apps.length === 0) {
getApps(); getApps();
} }
}, [getApps, apps]); }, [getApps]);
// Load bookmark categories // Load bookmark categories
useEffect(() => { useEffect(() => {
if (categories.length === 0) { if (categories.length === 0) {
getCategories(); getCategories();
} }
}, [getCategories, categories]); }, [getCategories]);
// Refresh greeter and time // Refresh greeter and time
useEffect(() => { useEffect(() => {

10
docker-compose.yml Normal file
View file

@ -0,0 +1,10 @@
version: "3"
services:
flame:
image: pawelmalak/flame
container_name: flame
volumes:
- /path/to/data:/app/data
ports:
- 5005:5005
restart: unless-stopped