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

add entrypoints example #624

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
FROM node:22.4.1 as node_base

FROM serversideup/php:8.3-fpm-nginx as base

COPY --chown=www-data:www-data ./docker/infra/certs /etc/nginx/certs
ENV S6_CMD_WAIT_FOR_SERVICES=1

COPY --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/
COPY ./docker/infra/certs /etc/nginx/certs

USER root

# run the docker-php-serversideup-s6-init script
RUN docker-php-serversideup-s6-init

USER www-data

# uncomment if you need to install chrome. eg. for spatie browser shot projects.
#USER root
Expand Down Expand Up @@ -31,19 +39,13 @@ ARG GROUP_ID
# Switch to root so we can set the user ID and group ID
USER root

ENV S6_CMD_WAIT_FOR_SERVICES=1

# make npm & node available in the container
COPY --chown=www-data:www-data --from=node_base /usr/local/bin /usr/local/bin
COPY --chown=www-data:www-data --from=node_base /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/npm


COPY --chmod=755 ./docker/entrypoint.d/ /etc/entrypoint.d

RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx

# run the docker-php-serversideup-s6-init script
RUN docker-php-serversideup-s6-init

# make npm & node available in the container
COPY --chown=www-data:www-data --from=node:22.4.1 /usr/local/bin /usr/local/bin

COPY --chown=www-data:www-data --from=node:22.4.1 /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/npm

USER www-data
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
volumes:
- .:/var/www/html/
restart: unless-stopped
working_dir: /var/www/html
networks:
- development
ports:
Expand Down
3 changes: 0 additions & 3 deletions docker/entrypoint.d/49-before-laravel-automations.sh

This file was deleted.

3 changes: 3 additions & 0 deletions entrypoint.d/51-after.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "hey there after running laravel automations"
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ rm -rf vendor/backpack

composer install --no-interaction --prefer-source --ansi

php artisan key:generate
php artisan key:generate

bash start.sh