Skip to content

Commit

Permalink
fix: delete the Symlinks between .env and the other two (#193)
Browse files Browse the repository at this point in the history
* fix: delete the Symlinks between .env and the other two

Closes: #179

* fix: edit the environnement variable to use it in just one .env

Closes: #179

* fix: delete the loading environment variable in index.php

the environnement variables are available from the container

Closes: #179

* fix: delete the environment variable for interface in docker-compose

Closes: #179

* fix: delete copy .env in Dockerfile

Closes: #179

* fix: add the environment variable into the docker-compose.prod.yml

Closes: #179
  • Loading branch information
ColinRgm authored Dec 9, 2024
1 parent 9b263d9 commit 81c1af8
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion Dockerfile/Node.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ FROM node:20.12.2-alpine3.19 as base
FROM base
WORKDIR /app
COPY ../nextjs-interface .
COPY ../.env .
RUN npm install
RUN node_modules/.bin/next build

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile/Node.dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:20.12.2-alpine3.19
WORKDIR /var/www/memoires-info/html/
COPY ../.env ../

ENTRYPOINT ["npm", "run", "dev"]

1 change: 0 additions & 1 deletion Dockerfile/Php.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ FROM php:8.3-fpm-alpine
COPY ../php/public /var/www/memoires-info/php/public
COPY ../php/src /var/www/memoires-info/php/src
COPY ../php/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

1 change: 0 additions & 1 deletion Dockerfile/Php.dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FROM php:8.3-fpm-alpine
WORKDIR /var/www/memoires-info/php
COPY ../.env ../

4 changes: 4 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ services:
image: php-memoires-info
depends_on:
- postg-rest
environment:
POSTGREST_API: ${POSTGREST_API}
DETAILED_ERRORS: ${DETAILED_ERRORS}
JWT_SECRET: ${JWT_SECRET}

interface:
build:
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ services:
- "./php:/var/www/memoires-info/php/"
depends_on:
- postg-rest
environment:
POSTGREST_API: ${POSTGREST_API}
DETAILED_ERRORS: ${DETAILED_ERRORS}
JWT_SECRET: ${JWT_SECRET}


interface:
build:
Expand Down
1 change: 0 additions & 1 deletion nextjs-interface/.env

This file was deleted.

1 change: 0 additions & 1 deletion php/.env

This file was deleted.

7 changes: 1 addition & 6 deletions php/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../lib.php';

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Symfony\Component\Dotenv\Dotenv;

// Load environment variables
$dotenv = new Dotenv();
$dotenv->load(__DIR__ . '/../.env');


// Set up the router
$app = AppFactory::create();
Expand Down

0 comments on commit 81c1af8

Please sign in to comment.