Skip to content

Commit

Permalink
refactor: rm nginx+fpm containers and use only frankenphp
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckadams committed Oct 17, 2024
1 parent aab6828 commit 2c6217c
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 130 deletions.
4 changes: 0 additions & 4 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ DB_USER=postgres
DB_PASS=password
DB_PORT=5432
DB_SCHEMA=public

# Default web service is nginx+fpm. Set to 'frankenphp' to use a frankenphp server instead.
# AP_COMPOSE_STACK=frankenphp
AP_COMPOSE_STACK=nginx
2 changes: 1 addition & 1 deletion .github/workflows/run-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build container
run: docker build --target dev -t aspirepress/aspirecloud-php -f ./docker/webapp-frankenphp/Dockerfile .
run: docker build --target dev -t aspirepress/aspirecloud-php -f ./docker/webapp/Dockerfile .

- name: Install Composer dependencies
run: docker run --rm -v $(pwd):/var/www/html aspirepress/aspirecloud-php sh -c "composer install"
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ ifneq (,$(wildcard ./.env))
export
endif

ifeq ($(AP_COMPOSE_STACK),frankenphp)
COMPOSE_FILE := docker-compose.frankenphp.yml
else
COMPOSE_FILE := docker-compose.yml
endif
COMPOSE_FILE := docker-compose.yml

list:
@grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down Expand Up @@ -131,7 +127,7 @@ rm-network: ## Remove application docker network. (traefik
-bin/remove-external-network.sh wp-services

build-prod:
docker build --target prod -t aspirepress/aspirecloud-php -f ./docker/webapp-frankenphp/Dockerfile .
docker build --target prod -t aspirepress/aspirecloud-php -f ./docker/webapp/Dockerfile .

traefik-up: network
docker compose -f docker/traefik/docker-compose.yml up -d
Expand Down
55 changes: 0 additions & 55 deletions docker-compose.frankenphp.yml

This file was deleted.

26 changes: 7 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
services:
nginx:
webapp:
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
dockerfile: docker/webapp/Dockerfile
target: dev
ports:
- ${LOCAL_HTTP_PORT:-8099}:80
- ${LOCAL_HTTPS_PORT:-8100}:443
volumes:
- .:/var/www/html
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
env_file:
- .env.dist
- .env
networks:
traefik: ~
aspirepress-cdn: ~
Expand All @@ -21,20 +23,6 @@ services:
- "traefik.http.routers.ap-api-https.rule=Host(`api.aspirepress.local`)"
- "traefik.http.routers.ap-api-https.tls=true"

webapp:
build:
context: .
dockerfile: docker/webapp-fpm/Dockerfile
target: devphp
volumes:
- .:/var/www/html
env_file:
- .env.dist
- .env
networks:
- aspirepress-cdn
- application

redis:
image: redis:latest
networks:
Expand All @@ -47,7 +35,7 @@ services:
- PGDATA=/opt/pgdata
- POSTGRES_DB=aspirepress_cdn
ports:
- ${LOCAL_POSTGRES_PORT:-5432}:5432
- "${LOCAL_POSTGRES_PORT:-5432}:5432"
volumes:
- postgresdata:/opt/pgdata
networks:
Expand Down
38 changes: 0 additions & 38 deletions docker/webapp-fpm/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions docker/webapp-frankenphp/php.ini

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ RUN install-php-extensions pdo pdo_pgsql zip intl redis

RUN apk add bash git postgresql-client zip

COPY ./docker/webapp-frankenphp/Caddyfile /etc/caddy/Caddyfile
COPY ./docker/webapp-frankenphp/php.ini /usr/local/etc/php/php.ini
COPY ./docker/webapp/Caddyfile /etc/caddy/Caddyfile
COPY ./docker/webapp/php.ini /usr/local/etc/php/php.ini

WORKDIR /var/www/html

Expand Down
File renamed without changes.

0 comments on commit 2c6217c

Please sign in to comment.