diff --git a/Dockerfile b/Dockerfile index 5ba3c31..adb0314 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,32 @@ #syntax=docker/dockerfile:1.4 FROM node:20-alpine +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +# hadolint ignore=DL3018 +RUN apk add --no-cache libc6-compat + WORKDIR /usr/src/app -COPY --link ./package.json ./package-lock.json ./ -COPY --link ./backend/package.json ./backend/package-lock.json ./backend/ -COPY --link ./frontend/package.json ./frontend/package-lock.json ./frontend/ -RUN npm install +RUN corepack enable && \ + corepack prepare --activate pnpm@latest && \ + pnpm config -g set store-dir /.pnpm-store + +COPY --link ./backend/package.json ./backend/ +COPY --link ./frontend/package.json ./frontend/ + +RUN cd frontend && \ + pnpm fetch && \ + pnpm install +RUN cd backend && \ + pnpm fetch && \ + pnpm install + +COPY ./frontend ./frontend + +RUN cd frontend && \ + pnpm run build + +COPY ./backend ./backend +COPY docker-entry.sh . -COPY ./ . +CMD ["sh","./docker-entry.sh"] diff --git a/backend/database/database.sql b/backend/database/database.sql index ed32c99..f0db026 100644 --- a/backend/database/database.sql +++ b/backend/database/database.sql @@ -419,23 +419,16 @@ CREATE TABLE `user` ( -- LOCK TABLES `user` WRITE; -/*!40000 ALTER TABLE `user` DISABLE KEYS */ -; - -INSERT INTO - `user` -VALUES ( - 1, 'johny', 'demo', '06 87 27 48 94', 'john.doe@externatic.com', '45 rue des cocotiers, Perpignan, 66100', '$2b$05$qmUzhYqnfbiQyfY0NZXaueKkDbInhO4pzZGuLnTT5JAUq5BJgdbeK', 0, 'loremipsul-mdolor' - ), - ( - 28, 'erftgyhuj', 'rfghj', 'rftgyhuj', 'adrien.russo@gmail.com', 'dcfvgbh', '$2b$05$8K8lbcHYqN5jZqO8mFzLW.YC8n4yVcIjk8fyz18Ud/vgkMVmfhR/i', 0, '' - ), - ( - 29, 'cass', 'cassiergegr', '098320498', 'cass@gmail.com', 'ç!\"\'(è rye àéç\"!àçé', '$2b$05$AnyuQBLohvbHr79KdBOj9OWmJfpu8ulSY2G2LQgqz/whDlSy1qKbq', 0, 'uploads/05d0d336a101ed3b078b4153b7378bf8.avif' +/*!40000 ALTER TABLE `user` DISABLE KEYS */; +INSERT INTO `user` VALUES (1,'johny','demo','06 87 27 48 94','john.doe@externatic.com','45 rue des cocotiers, Perpignan, 66100','$2b$05$qmUzhYqnfbiQyfY0NZXaueKkDbInhO4pzZGuLnTT5JAUq5BJgdbeK',0,'loremipsul-mdolor' +),( + 28,'erftgyhuj','rfghj','rftgyhuj','adrien.russo@gmail.com','dcfvgbh','$2b$05$8K8lbcHYqN5jZqO8mFzLW.YC8n4yVcIjk8fyz18Ud/vgkMVmfhR/i',0,'' + ),( + 29,'cass','cassiergegr','098320498','cass@gmail.com','ç!\"\'(è rye àéç\"!àçé','$2b$05$AnyuQBLohvbHr79KdBOj9OWmJfpu8ulSY2G2LQgqz/whDlSy1qKbq',0,'uploads/05d0d336a101ed3b078b4153b7378bf8.avif' + ),( + 44, "John", "Doe", "0606060606", "john.doe@externatic.fr", "06 Ure", "$2b$05$P3w2mRO1X1DPbrVsQocyfupP20xBlgEZGrNfimpoAFCzf4f.mTqTS", 1, 'uploads/05d0d336a101ed3b078b4153b7378bf8.avif' ); -/*!40000 ALTER TABLE `user` ENABLE KEYS */ -; - +/*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; -- diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index e994e10..f85be76 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -3,11 +3,7 @@ version: '3.4' services: web: build: . - container_name: ${PROJECT_NAME:-project}-web - volumes: - - .:/usr/src/app:delegated - - ./docker-entry.sh:/etc/entrypoint.sh - entrypoint: [ "sh", "/etc/entrypoint.sh" ] + container_name: ${PROJECT_NAME}-web env_file: - ../envs/.env-${GITHUB_REPOSITORY_NAME} environment: @@ -24,9 +20,9 @@ services: labels: - "traefik.enable=true" - "traefik.docker.network=proxy" - - "traefik.http.routers.${PROJECT_NAME:-project}-secure.entrypoints=websecure" - - "traefik.http.routers.${PROJECT_NAME:-project}-secure.rule=Host(`${PROJECT_NAME:-project}.${HOST:-localhost}`)" - - "traefik.http.services.${PROJECT_NAME:-project}.loadbalancer.server.port=3310" + - "traefik.http.routers.${PROJECT_NAME}-secure.entrypoints=websecure" + - "traefik.http.routers.${PROJECT_NAME}-secure.rule=Host(`${PROJECT_NAME}.${HOST}`)" + - "traefik.http.services.${PROJECT_NAME}.loadbalancer.server.port=3310" networks: proxy: diff --git a/docker-compose.yml b/docker-compose.yml index e92d2d4..782531b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,5 +38,6 @@ services: # Password for root access MYSQL_ROOT_PASSWORD: rootpassword ports: - - "3306" - + - target: 3306 + published: 3306 + protocol: tcp diff --git a/docker-entry.sh b/docker-entry.sh index e5a2fe0..80f708c 100644 --- a/docker-entry.sh +++ b/docker-entry.sh @@ -1,6 +1,3 @@ #!/usr/bin/env sh -sleep 5 -npm install -npm run build -npm run start +cd /usr/src/app/backend && node migrate.js && node index.js diff --git a/frontend/src/components/Dashboards/RowDash.css b/frontend/src/components/Dashboards/RowDash.css index 4dae76a..f1f8bda 100644 --- a/frontend/src/components/Dashboards/RowDash.css +++ b/frontend/src/components/Dashboards/RowDash.css @@ -1,25 +1,50 @@ .offerDash-item { display: flex; justify-content: space-between; - box-shadow: 5px 5px 15px 8px rgba(217, 217, 217, 0.53); - padding: 10px 35px; - margin-bottom: 20px; } -.array-box, -.bigArray-box { - margin-inline: 5px; - margin: 25px 0; + +.offerDash-item { + display: flex; + background-color: var(--background-input); + margin-block: 10px; + padding: 5px 10px; + border-radius: 10px; + align-items: center; } -.array-box { - width: 12%; + +.offerDash-item > p { + font-size: 14px; } -.bigArray-box { - width: 32%; + +.offerDash-item > p:nth-child(2) { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 70px; } + .icon-dash { display: flex; - justify-content: space-between; - margin: 25px 0; - width: 100px; - color: var(--second-color); + flex-direction: column; +} + +@media screen and (min-width: 1200px) { + .offerDash-item > p { + font-size: 20px; + margin-block: 10px; + } + + .offerDash-item > p:nth-child(2) { + white-space: initial; + max-width: 100px; + } + + .icon-dash { + flex-direction: row; + } + + .icon-dash > button > i { + font-size: 20px; + margin-right: 20px; + } } diff --git a/frontend/src/components/Dashboards/RowDash.jsx b/frontend/src/components/Dashboards/RowDash.jsx index 4e1c9a6..b06c4df 100644 --- a/frontend/src/components/Dashboards/RowDash.jsx +++ b/frontend/src/components/Dashboards/RowDash.jsx @@ -55,7 +55,6 @@ function RowDash() {
{offer.id}
{offer.company}
{offer.NbrCandidats}
-En ligne
{offer.email}