Skip to content

Commit

Permalink
misc: docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
amvid committed May 8, 2024
1 parent 99af0e1 commit 6bdbaa9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .docker/php/config/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ max_input_time = 60

; Maximum amount of memory a script may consume
; https://php.net/memory-limit
memory_limit = 256M
memory_limit = 512M

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
Expand Down
1 change: 1 addition & 0 deletions .docker/php/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM php:8.3.6-cli-alpine3.18

RUN --mount=type=bind,from=mlocati/php-extension-installer:1.5,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions pdo pdo_mysql zip opcache xsl dom exif intl pcntl bcmath sockets && \
apk add --no-cache git unzip && \
apk del --no-cache ${PHPIZE_DEPS} ${BUILD_DEPENDS}

WORKDIR /var/www/geo-service
Expand Down
16 changes: 4 additions & 12 deletions .docker/php/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
#!/usr/bin/env sh

if [ -d "vendor" ]; then
echo "Vendor folder exists. Skipping 'composer install'."
else
composer install
bin/console assets:install
fi
composer install
bin/console assets:install

if [ -f "bin/rr" ]; then
echo "RR binary exists. Skipping 'vendor/bin/rr get-binary'."
else
vendor/bin/rr get-binary -f v2024.1.1 --location bin
chmod +x bin/rr
fi
vendor/bin/rr get-binary -f v2024.1.1 --location bin
chmod +x bin/rr

bin/rr serve -c .rr.dev.yaml
3 changes: 2 additions & 1 deletion .docker/php/Dockerfile → .docker/php/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM php:8.3.6-cli-alpine3.18

RUN --mount=type=bind,from=mlocati/php-extension-installer:1.5,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions pdo pdo_mysql zip opcache xsl dom exif intl pcntl bcmath sockets && \
apk add --no-cache git unzip && \
apk del --no-cache ${PHPIZE_DEPS} ${BUILD_DEPENDS}

WORKDIR /var/www/geo-service
Expand All @@ -19,6 +20,6 @@ RUN composer install --optimize-autoloader --no-dev --prefer-dist \

COPY --from=ghcr.io/roadrunner-server/roadrunner:2024.1.1 /usr/bin/rr ./bin/rr

EXPOSE 8080/tcp
EXPOSE 80/tcp

CMD ./bin/rr serve -c .rr.yaml
2 changes: 1 addition & 1 deletion .github/workflows/docker_image_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: .docker/php/Dockerfile
file: .docker/php/prod.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dev:

.PHONY: coldstart
coldstart:
rm -rf vendor
rm bin/rr
-rm -rf vendor
-rm bin/rr
@docker compose up -d
@docker exec geo-service-app-dev sh -c "composer install"
@docker exec geo-service-app-dev sh -c "bin/console d:m:m"
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: "3"
networks:
geo-service-network:


services:
geo-service-app:
build:
Expand Down

0 comments on commit 6bdbaa9

Please sign in to comment.