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

build: create local dev environment that mirrors kube #1891

Merged
merged 85 commits into from
Jan 11, 2024

Conversation

marvinroman
Copy link
Contributor

Creates a local deployment that more closely mirrors Kube containers.

Creates a new docker-compose configuration that uses container builds for Kube.

Has some convenience features like setting user id to be identical to development environment allowing user to adjust files mounted into the containers without permission issues.

Included instructions on how to deploy.

Walked through instructions within README.md to make sure that it would create a working deployment.

added ability to backup seeders first. added truncating and seeding of filament tables.
…-the-admin-interfaces' into feat/create-local-dev-environment-that-mirrors-kube
…-the-admin-interfaces' into feat/create-local-dev-environment-that-mirrors-kube
…-the-admin-interfaces' into feat/create-local-dev-environment-that-mirrors-kube
…we are able to handle attachment to other tables
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated
Comment on lines 307 to 309
```bash
docker run --rm --entrypoint '' platform.test php artisan key:generate --show
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why but this image is actually called platform-platform.test for me. So the above command other's that refer to the image name all fail. I'm not sure if this is a problem with the documentation here or something specific to my system, but I did prune out everything in docker and it still came up as I mentioned.

Copy link
Contributor Author

@marvinroman marvinroman Nov 1, 2023

Choose a reason for hiding this comment

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

I have fixed the command. I deleted all local images and volumes and stepped through each step to recreate and fixed all the instruction steps and commands.


For comprehensive instructions, consult the [Laravel documentation](https://laravel.com/docs/9.x). Here's an overview of how some key tasks can be carried out using your containers:

- Visit the site using the SSL proxy to make sure assets load [https://localhost](https://localhost).
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wasn't able to load the site, just says unable to connect in the browser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a section under Troubleshooting Cannot reach site using browser for some commands to try and figure out why it might not be running.

docker-compose.local.yml Outdated Show resolved Hide resolved
Copy link
Contributor Author

@marvinroman marvinroman left a comment

Choose a reason for hiding this comment

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

Changes to the docker build. It will affect Kube container builds.

RUN docker-php-ext-install opcache
RUN docker-php-ext-configure intl
RUN docker-php-ext-install intl
RUN docker-php-ext-install -j$(nproc) gd pdo_mysql mbstring exif pcntl bcmath bz2 zip soap intl opcache
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consolidated extensions to one line to speed up building container. Each time this command is run a build environment has to be created.

ENV NVM_VERSION 0.39.3
ENV NVM_DIR /root/.nvm
ENV NVM_DIR /var/www/.nvm
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change install location for NVM so that it's available to other users.

@@ -1,9 +1,9 @@
FROM php:8.1-fpm

ENV PHP_VERSION 8.1
ENV NODE_VERSION 18
ENV NODE_VERSION 18.18.2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make the version more explicit so directory it's installed will be correctly added to $PATH.

Comment on lines +192 to +194
```bash
docker compose -f docker-compose.local.yml run --rm --entrypoint '' platform.test php artisan key:generate --show
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

@marvinroman, this step failed with dependency failed to start: container platform.redis exited (1) From the Docker logs related to Redis:

2023-11-02 07:54:48 redis 11:54:48.67 
2023-11-02 07:54:48 redis 11:54:48.67 Welcome to the Bitnami redis container
2023-11-02 07:54:48 redis 11:54:48.68 Subscribe to project updates by watching https://github.com/bitnami/containers
2023-11-02 07:54:48 redis 11:54:48.68 Submit issues and feature requests at https://github.com/bitnami/containers/issues
2023-11-02 07:54:48 redis 11:54:48.69 
2023-11-02 07:54:48 redis 11:54:48.69 INFO  ==> ** Starting Redis setup **
2023-11-02 07:54:48 redis 11:54:48.72 ERROR ==> The REDIS_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development.

I didn't see the App key generated either, but I suppose it may be because it didn't get that far.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added creating redis password to the instructions.

@jobara jobara modified the milestones: 1.2.0, 1.3.0 Nov 21, 2023
@jobara
Copy link
Collaborator

jobara commented Jan 10, 2024

@marvinroman could you please look at the merge conflicts with this PR? I hope to find some more time to review this after the conflicts are addressed.

@marvinroman
Copy link
Contributor Author

@jobara I have merged in dev and resolved the conflict.

@jobara jobara changed the title Feat/create local dev environment that mirrors kube build: create local dev environment that mirrors kube Jan 11, 2024
@jobara jobara enabled auto-merge (squash) January 11, 2024 15:14
@jobara jobara merged commit 4b552b8 into dev Jan 11, 2024
7 checks passed
@jobara jobara deleted the feat/create-local-dev-environment-that-mirrors-kube branch January 11, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Create local development environment that runs on same container builds as Kube
2 participants