Restructure Docker for Dokploy deployment

- Copy app code into PHP image, sync to shared volume at startup
- Use named volume (app_code) shared between app and nginx
- Build nginx image with embedded config (no bind mounts)
- Add .dockerignore to optimize image build
- Build context moved to project root for both services
This commit is contained in:
root
2026-04-05 20:09:12 +02:00
parent 3abde23629
commit 1632b568af
5 changed files with 50 additions and 9 deletions

View File

@@ -42,14 +42,17 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
# Set working directory
WORKDIR /var/www/html
# Copy application code to staging area
COPY . /app-src/
# Copy PHP configuration
COPY php.ini /usr/local/etc/php/conf.d/custom.ini
COPY docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini
# Copy PHP-FPM pool config
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
COPY docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf
# Copy entrypoint
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 9000