Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a dockerfile & docker-compose #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

elmariachi111
Copy link

just in case your local php is not a nice php.
copied pasted and tested. won't work without more commands. eg

eg
docker build -t php:sflive . --network=host --build-arg UID=1001 --build-arg GID=1001
docker-compose up php

@elmariachi111
Copy link
Author

PS: noted that the WIfi in Mercure hotel is eating your DNS so APK might not be reachable -> the --network=host option might help you to work around that. You can also try to add dns config to your docker-compose file

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall huge improvement to have a Dockerfile and docker-compose up to see what's going on, but the Dockerfile reeeeeally needs to be slimmed down to a raw dev environment only.

ARG UID=1000
ARG APP_ENV=dev

# Prevent Symfony Flex from generating a project ID at build time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No flex in this project, luckily :)

bash \
;

ARG APCU_VERSION=5.1.12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be dropped

zip \
; \
pecl install \
apcu-${APCU_VERSION} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be dropped

; \
pecl clear-cache;
RUN docker-php-ext-enable \
apcu \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be dropped

; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhhh, what the heck is going on here? (generally unfamiliar with all this)


WORKDIR ${APP_PATH}

COPY composer.json composer.lock ./
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project has no deployment/build target: having just the volume mounted, and composer install performed inside the container (with the mounted volume) would be preferable

composer install --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest; \
composer clear-cache

COPY . ./
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above: container should be configured for dev purposes only: all blocks performing ADD or COPY should probably be removed

context: .
ports:
- "7811:8080"
dns:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably to be dropped - host DNS resolution should suffice

realpath_cache_size = 4096K
realpath_cache_ttl = 600

[opcache]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opcache not really needed in the scope of this project

@Ocramius Ocramius added the enhancement New feature or request label Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants