Refactor Docker setup and update API documentation

- Renamed Dockerfile to lowercase for consistency and clarity.
- Introduced a new Dockerfile for the Laravel application, utilizing PHP 8.2 and installing necessary dependencies, including NTP for time synchronization.
- Removed the docker-entrypoint.sh script, which previously generated API documentation, streamlining the container startup process.
- Updated API documentation with new response formats and example values for `currencyName` and `goldName`, enhancing clarity and usability.
- Adjusted endpoint responses to reflect the latest currency and gold rates, ensuring accurate data delivery.

These changes improve the Docker environment and enhance the API's documentation and response accuracy, contributing to a more robust application setup.
This commit is contained in:
Ümit Tunç
2025-01-21 09:28:15 +03:00
parent 677da3892d
commit 3e10131f81
5 changed files with 20 additions and 46 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -5
View File
@@ -2,17 +2,13 @@ services:
app: app:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: dockerfile
image: truncgil-finance-app image: truncgil-finance-app
container_name: truncgil-finance-app container_name: truncgil-finance-app
volumes: volumes:
- .:/var/www - .:/var/www
networks: networks:
- laravel-network - laravel-network
environment:
- TZ=Europe/Istanbul
- APP_ENV=production
- APP_DEBUG=false
web: web:
image: nginx:alpine image: nginx:alpine
-6
View File
@@ -1,6 +0,0 @@
#!/bin/bash
# API dokümantasyonunu güncelle
php artisan scribe:generate
echo "API dokümantasyonu güncellendi"
+3 -19
View File
@@ -1,9 +1,6 @@
# Laravel için PHP 8.2 resmi imajını kullanıyoruz # Laravel için PHP 8.2 resmi imajını kullanıyoruz
FROM php:8.2-fpm FROM php:8.2-fpm
ENV TZ=Europe/Istanbul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Çalışma dizinini belirleyelim # Çalışma dizinini belirleyelim
WORKDIR /var/www WORKDIR /var/www
@@ -50,11 +47,9 @@ RUN set -x && \
chmod -R 775 /var/www/storage/framework/views && \ chmod -R 775 /var/www/storage/framework/views && \
echo "Views izinleri ayarlandı" && \ echo "Views izinleri ayarlandı" && \
chmod -R 775 /var/www/public && \ chmod -R 775 /var/www/public && \
echo "Public dizin izinleri ayarlandı" && \ echo "Public dizin izinleri ayarlandı"
echo "0 0 * * * root /usr/sbin/ntpdate -u pool.ntp.org" >> /etc/crontab && \
echo "Otomatik saat güncelleme ayarlandı"
# Laravel uygulamasını başlatma ve loglama # Laravel uygulamasını başlatma ve loglama
RUN set -x && \ RUN set -x && \
echo "Laravel kurulum komutları başlatılıyor..." && \ echo "Laravel kurulum komutları başlatılıyor..." && \
php artisan migrate && \ php artisan migrate && \
@@ -71,15 +66,4 @@ RUN set -x && \
echo "Storage sembolik bağlantısı oluşturuldu" && \ echo "Storage sembolik bağlantısı oluşturuldu" && \
php artisan scribe:generate && \ php artisan scribe:generate && \
echo "API dokümantasyonu oluşturuldu" && \ echo "API dokümantasyonu oluşturuldu" && \
echo "Laravel uygulaması başarıyla başlatıldı." echo "Laravel uygulaması başarıyla başlatıldı.";
# Apache veya Nginx kullanılacaksa, burada ayarları yapabiliriz (Opsiyonel)
# Container başlangıcında çalışacak script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN composer install --no-dev --optimize-autoloader
ENTRYPOINT ["docker-entrypoint.sh"]