Skip to content

Commit

Permalink
Remove nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
lancedalanon committed Nov 1, 2024
1 parent 98cdd86 commit cc0c1a5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 70 deletions.
26 changes: 19 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM richarvey/nginx-php-fpm:latest
# Use the lightweight PHP image with FPM
FROM php:8.2-fpm-alpine AS build

# Install necessary extensions
RUN apk add --no-cache libpng-dev libjpeg-turbo-dev libwebp-dev libxpm-dev \
&& docker-php-ext-configure gd --with-jpeg --with-webp --with-xpm \
&& docker-php-ext-install gd pdo pdo_mysql

# Set the working directory to the root
WORKDIR /var/www/html

# Copy all PHP files into the container
COPY . .

# Image config
ENV SKIP_COMPOSER 1
ENV WEBROOT /var/www/html/public
ENV PHP_ERRORS_STDERR 1
ENV RUN_SCRIPTS 1
ENV REAL_IP_HEADER 1
# Set permissions (if needed)
RUN chown -R www-data:www-data /var/www/html

# Expose port 80
EXPOSE 80

# Start PHP-FPM
CMD ["php-fpm"]
61 changes: 0 additions & 61 deletions conf/nginx/nginx-site.conf

This file was deleted.

8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ services:
context: . # Build context is the current directory
dockerfile: Dockerfile
volumes:
- .:/var/www/html/public # Adjust if your structure differs
- .:/var/www/html # Adjust if your structure differs
networks:
- app-network
depends_on:
- db # Ensure db is started before app
ports:
- "80:80" # Map port 80 of the container to port 80 on the host

db:
image: mysql:5.7
volumes:
- ./database:/docker-entrypoint-initdb.d
- ./database:/docker-entrypoint-initdb.d # SQL scripts will be executed on first run
environment:
MYSQL_DATABASE: intramuros
MYSQL_ROOT_PASSWORD: yourpassword # Change to a strong password
Expand Down

0 comments on commit cc0c1a5

Please sign in to comment.