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

refactor: reposition php code in the folder #25

Merged
merged 3 commits into from
Jun 10, 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
12 changes: 0 additions & 12 deletions Dockerfile.Php

This file was deleted.

10 changes: 5 additions & 5 deletions Dockerfile.Nginx → Dockerfile/Dockerfile.Nginx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# node 20, build the application
FROM node:20.12.2-alpine3.19
COPY Interface .
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 --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
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
COPY ../php/public /var/www/memoires-info/php/public

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

# copy required files to new image
FROM php:8.3-fpm-alpine
COPY ../php/public /var/www/memoires-info/php/public
COPY ../php/private /var/www/memoires-info/php/private
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

File renamed without changes.
6 changes: 3 additions & 3 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
migration:
build:
context: .
dockerfile: Dockerfile.Sqitch
dockerfile: Dockerfile/Dockerfile.Sqitch
image: sqitch-memoires-info
environment:
SQITCH_TARGET: "db:pg://postgres:${POSTGRES_PASSWORD}@db:5432/memoires-info"
Expand All @@ -53,15 +53,15 @@ services:
php:
build:
context: .
dockerfile: Dockerfile.Php
dockerfile: Dockerfile/Dockerfile.Php
image: php-memoires-info
depends_on:
- postg-rest

web:
build:
context: .
dockerfile: Dockerfile.Nginx
dockerfile: Dockerfile/Dockerfile.Nginx
image: nginx-memoires-info
ports:
- '80:80'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions php/public/esp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
require_once __DIR__ . '/../private/esp.php';
2 changes: 2 additions & 0 deletions php/public/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
require_once __DIR__ . '/../private/login.php';