Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for Sprint 2 #84

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ COPY ./src /var/www/html

#* Create a development stage.
FROM base AS development
COPY ./tests /var/www/html/tests
# Add PECL extensions, and enable Xdebug.
# See https://github.com/docker-library/docs/tree/master/php#pecl-extensions
RUN pecl install xdebug-3.2.1 \
&& docker-php-ext-enable xdebug
# RUN pecl install xdebug-3.2.1 \
# && docker-php-ext-enable xdebug
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --from=dev-deps app/vendor/ /var/www/html/vendor

#* Run tests when building
# FROM development AS test
# COPY ./tests /var/www/html/tests
# WORKDIR /var/www/html
# RUN ./vendor/bin/phpunit tests/HelloWorldTest.php

Expand All @@ -47,4 +47,4 @@ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --from=prod-deps app/vendor/ /var/www/html/vendor
# Switch to a non-privileged user (defined in the base image) that the app will run under.
# See https://docs.docker.com/go/dockerfile-user-best-practices/
USER www-data
USER www-data
24 changes: 7 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,19 @@

Aplicatiu web per a la gestió del manteniment d'arbrat urbà i periurbà.

<!-- Nomenclatura per a la Base de Dades moguda a la [wiki](https://github.com/Projecte-UrbanTree/UrbanTree/wiki/Naming-Conventions) -->

## Instruccions d'instal·lació

1. **Preparació de l'entorn de desenvolupament:**
Abans de començar, has de garantir que tens Composer instal·lat a la teva màquina. Si no el tens, el pots descarregar des [d'aquí](https://getcomposer.org/).

Executa el següent comandament per instal·lar les dependències del projecte:

```bash
composer install
```
**Arrencar l'entorn amb Docker:**

2. **Arrencar l'entorn amb Docker:**
Un cop les dependències estiguin instal·lades, pots arrencar l'entorn de desenvolupament utilitzant Docker. Executa el següent comandament:
```bash
docker-compose up --build --watch --remove-orphans
```
Executa el següent comandament:
```bash
docker-compose up --build --watch --remove-orphans
```

Això crearà els contenidors necessaris per al projecte i posarà en marxa l'aplicació.
Executar-ho crearà els contenidors necessaris per al projecte i posarà en marxa l'aplicació.

---

Accedir a l'aplicació en entorn de desenvolupament: [http://localhost:8000](http://localhost:8000)

Accedir al phpMyAdmin:: [http://localhost:8080](http://localhost:8080)
Accedir al phpMyAdmin:: [http://localhost:8080](http://localhost:8080)
5 changes: 3 additions & 2 deletions docker/database/start-scripts/0-init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,12 @@ create table work_reports (
create table sensors (
id int auto_increment primary key,
zone_id int not null,
point_id int unique,
model varchar(255),
class varchar(255),
is_active boolean,
created_at timestamp default current_timestamp,
foreign key (zone_id) references zones(id)
foreign key (zone_id) references zones(id),
foreign key (point_id) references points(id)
);

create table sensor_history (
Expand Down