-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: master
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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} \ |
There was a problem hiding this comment.
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 \ |
There was a problem hiding this comment.
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 \ |
There was a problem hiding this comment.
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 ./ |
There was a problem hiding this comment.
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 . ./ |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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
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