diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..32e8842 --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Release Notes + +### New Features +- Changed **web panel** backend, so you don't need to set the API key anymore. [Web Panel](https://weather.the1s.de) +- You can now see the **last updated** time in the web panel. + +### Improvements +- Changed Website Icons to lucide react icons +- Changed overall handling of the panel \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 90023c8..bf57074 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,27 +3,13 @@ services: container_name: weather-frontend build: ./frontend ports: - - "7002:7002" - networks: - - proxynet - environment: - - CHOKIDAR_USEPOLLING=true - volumes: - - ./frontend:/app - - /app/node_modules - restart: unless-stopped - backend: - container_name: weather-backend - build: ./backend - networks: - - proxynet - ports: - - "7001:7001" - volumes: - - ./backend:/app - - /app/node_modules - restart: unless-stopped - -networks: - proxynet: - external: true + - "7002:80" + restart: always +# backend: +# container_name: backend +# build: ./backend +# ports: +# - "7001:7001" +#volumes: +# - ./backend:/bikelane-backend +# restart: unless-stopped diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 7d384f8..3611744 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,12 +1,19 @@ -FROM node:20-alpine +FROM node:22-alpine AS builder WORKDIR /app -COPY package*.json ./ -RUN npm install +COPY package.json package-lock.json ./ +RUN npm ci COPY . . +RUN npm run build -EXPOSE 7002 +FROM nginx:alpine AS runner -CMD ["npm", "run", "dev"] \ No newline at end of file +WORKDIR /usr/share/nginx/html +COPY --from=builder /app/dist . + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..4aa4fa8 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(?:js|mjs|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ { + expires 1y; + access_log off; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } +} \ No newline at end of file diff --git a/frontend/src/components/ChangeAPI.tsx b/frontend/src/components/ChangeAPI.tsx index 1386233..b8b4657 100644 --- a/frontend/src/components/ChangeAPI.tsx +++ b/frontend/src/components/ChangeAPI.tsx @@ -53,7 +53,7 @@ const ChangeAPI: React.FC = ({ currentAPIKey, onClose }) => {