Skip to content

Commit

Permalink
Fix: fix a few issues on the backend (#6)
Browse files Browse the repository at this point in the history
fix: fix 404 when trying to access router path

fix: rename ngnix conf file

fix: add font back in esp32 config

fix: post request of type json now get decoded

feat: get esp jwt token from the php

fix: "sequence user_id_seq not exist" when creating database

fix: give nginx it's real name back

I'll probably write it wrong next time I have to write it ^^"

fix: add lockfile to ensure plugin's hash match

feat: make production docker compose

fix: take pg password from .env

fix: put interface in the right directory and remove adminer

fix: rename add-esp.php to esp.php cause ngnix fail with the -

refactor: change docker images to take images from last feature version at this date

fix: copy .env in the php container

fix: handle web socker for esphome

esphome needs web sockets to work, without them it just freezes right before the compilation

dev: script to reset the state of the mounted volumes\n\n this script is ignored by the gitignore

feat: specify default user in readme

refactor: change the url to use Subdirectory instead of subdomain

fix: repare sed at build of prod

fix: postgrest subdirectory now redirect to postg-rest container

fix: restore php and postgrest url call

fix: 404 when sending data from esp to database

refactor: group all .env file in a single one

fix: update readme

fix: update readme

fix: make readme easier to understand

fix: remove hard coded env variable from Dockerfile.Postgres
  • Loading branch information
Rignchen authored May 31, 2024
1 parent 9042cb9 commit 308e75f
Show file tree
Hide file tree
Showing 20 changed files with 5,598 additions and 122 deletions.
7 changes: 6 additions & 1 deletion login/.env.example → .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
JWT_SECRET=
POSTGREST_API=http://postg-rest:3000
DETAILED_ERRORS=false

ESP_PATH=./esp32/config
DB_PATH=./database/data

JWT_SECRET=
POSTGRES_PASSWORD=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea
# vim backup files
*.sw[pon]
.env
# test bash script
reset_test.sh
19 changes: 19 additions & 0 deletions Dockerfile.Nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# node 20, build the application
FROM node:20.12.2-alpine3.19
COPY Interface .
RUN npm install
RUN npm run build


# nginx 1.26 on port 80, keep the build output, nginx config
FROM nginx:1.26-alpine-otel
EXPOSE 80
COPY --from=0 ./dist /var/www/memoires-info/html
COPY .env /var/www/memoires-info/html/.env

# copy the nginx config
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
RUN sed -i '/location \/adminer\//,/}/d' /etc/nginx/conf.d/default.conf
# copy php files for ngnix to know they exist
COPY login/public /var/www/memoires-info/php/public

12 changes: 12 additions & 0 deletions Dockerfile.Php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# php 8.3 with the files, install dependencies
FROM composer:2.7.4
COPY login .
RUN composer install

# copy required files to new image
FROM php:8.3-fpm-alpine
COPY login/public /var/www/memoires-info/php/public
COPY login/lib.php /var/www/memoires-info/php
COPY .env /var/www/memoires-info/php/
COPY --from=0 ./app/vendor /var/www/memoires-info/php/vendor

3 changes: 3 additions & 0 deletions Dockerfile.Postgres
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM postgres:12.19-alpine
COPY ./database/db.sql /docker-entrypoint-initdb.d/db.sql

1 change: 0 additions & 1 deletion Interface/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package-lock.json
/src/contexts/SampleContext.tsx
/test.http

Expand Down
Loading

0 comments on commit 308e75f

Please sign in to comment.