@fishawack/lab-env 4.40.1 → 4.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/_Ai/laravel-12.md +158 -0
- package/_Ai/vue-3.md +235 -0
- package/bitbucket-pipelines.yml +2 -2
- package/cli.js +2 -1
- package/commands/create/cmds/diagnose.js +0 -1
- package/globals.js +57 -1
- package/laravel/10/docker-compose.yml +72 -0
- package/laravel/10/php/CHANGELOG.md +4 -0
- package/laravel/10/php/Dockerfile +40 -0
- package/laravel/10/php/custom.ini +5 -0
- package/laravel/10/php/entrypoint.sh +24 -0
- package/laravel/10/php/package.json +11 -0
- package/laravel/10/php/policy.xml +99 -0
- package/package.json +3 -3
- package/php/8.2/CHANGELOG.md +4 -0
- package/php/8.2/Dockerfile +40 -0
- package/php/8.2/custom.ini +5 -0
- package/php/8.2/docker-compose.yml +23 -0
- package/php/8.2/entrypoint.sh +24 -0
- package/php/8.2/package.json +11 -0
- package/php/8.2/policy.xml +99 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.41.0 (2025-07-24)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* added suport for laravel 12 with php 8.2 ([a2a66de](https://bitbucket.org/fishawackdigital/lab-env/commits/a2a66de178b622702074cb7abc17810a8a4228c4))
|
|
8
|
+
* added support for flat php repositories ([85398c5](https://bitbucket.org/fishawackdigital/lab-env/commits/85398c56d764003f5c724b726f986f578518a160))
|
|
9
|
+
* added support for laravel 10 with php 8.2 ([6eaeea2](https://bitbucket.org/fishawackdigital/lab-env/commits/6eaeea2a3346f912182914737c4e0e85e4592541))
|
|
10
|
+
* copy github copilot instructions into repo ([06d4eaf](https://bitbucket.org/fishawackdigital/lab-env/commits/06d4eaf26db244381d6f751687c57604e4ad8a2f))
|
|
11
|
+
|
|
12
|
+
#### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* allow composer and php command for php projects and copy laravel instructions file ([5536d4d](https://bitbucket.org/fishawackdigital/lab-env/commits/5536d4d0584d8612d67acf761e7fe9d86048a01b))
|
|
15
|
+
* safe check for composer name ([c0c2584](https://bitbucket.org/fishawackdigital/lab-env/commits/c0c2584444318bad3d47ec7d5a22556024288ced))
|
|
16
|
+
|
|
17
|
+
#### Build Updates
|
|
18
|
+
|
|
19
|
+
* dont allow empty commits on aws-runner bump as it should never be empty ([899e6c5](https://bitbucket.org/fishawackdigital/lab-env/commits/899e6c590bca630ca72484b16a7d1dc85bace736))
|
|
20
|
+
* grab the new lab-env version from the package.json rather than npm view command ([b53fe14](https://bitbucket.org/fishawackdigital/lab-env/commits/b53fe14a0e88f04d1797f6960a8c145974d25e19))
|
|
21
|
+
* ran npm pkg fix to stop publish from throwing errors ([58158d5](https://bitbucket.org/fishawackdigital/lab-env/commits/58158d58d7627bd7b70237a8e6d4de2cc6ab97ac))
|
|
22
|
+
|
|
23
|
+
### 4.41.0-beta.1 (2025-07-24)
|
|
24
|
+
|
|
25
|
+
#### Features
|
|
26
|
+
|
|
27
|
+
* added suport for laravel 12 with php 8.2 ([a2a66de](https://bitbucket.org/fishawackdigital/lab-env/commits/a2a66de178b622702074cb7abc17810a8a4228c4))
|
|
28
|
+
* added support for flat php repositories ([85398c5](https://bitbucket.org/fishawackdigital/lab-env/commits/85398c56d764003f5c724b726f986f578518a160))
|
|
29
|
+
* added support for laravel 10 with php 8.2 ([6eaeea2](https://bitbucket.org/fishawackdigital/lab-env/commits/6eaeea2a3346f912182914737c4e0e85e4592541))
|
|
30
|
+
* copy github copilot instructions into repo ([06d4eaf](https://bitbucket.org/fishawackdigital/lab-env/commits/06d4eaf26db244381d6f751687c57604e4ad8a2f))
|
|
31
|
+
|
|
32
|
+
#### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* allow composer and php command for php projects and copy laravel instructions file ([5536d4d](https://bitbucket.org/fishawackdigital/lab-env/commits/5536d4d0584d8612d67acf761e7fe9d86048a01b))
|
|
35
|
+
* safe check for composer name ([c0c2584](https://bitbucket.org/fishawackdigital/lab-env/commits/c0c2584444318bad3d47ec7d5a22556024288ced))
|
|
36
|
+
|
|
37
|
+
#### Build Updates
|
|
38
|
+
|
|
39
|
+
* dont allow empty commits on aws-runner bump as it should never be empty ([899e6c5](https://bitbucket.org/fishawackdigital/lab-env/commits/899e6c590bca630ca72484b16a7d1dc85bace736))
|
|
40
|
+
* grab the new lab-env version from the package.json rather than npm view command ([b53fe14](https://bitbucket.org/fishawackdigital/lab-env/commits/b53fe14a0e88f04d1797f6960a8c145974d25e19))
|
|
41
|
+
* ran npm pkg fix to stop publish from throwing errors ([58158d5](https://bitbucket.org/fishawackdigital/lab-env/commits/58158d58d7627bd7b70237a8e6d4de2cc6ab97ac))
|
|
42
|
+
|
|
3
43
|
### 4.40.1 (2025-07-16)
|
|
4
44
|
|
|
5
45
|
#### Bug Fixes
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# GitHub Copilot Instructions for Laravel Containerized Project
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
This is a Laravel application that runs entirely in Docker containers. All PHP, Composer, and database operations must be executed within the appropriate containers using our `fw` container orchestration manager.
|
|
6
|
+
|
|
7
|
+
## Container Management
|
|
8
|
+
|
|
9
|
+
- **All PHP/Composer commands run in containers** - never suggest direct `php` or `composer` commands
|
|
10
|
+
- Use the `fw` orchestration manager to execute all commands within containers
|
|
11
|
+
- The project uses Docker with services like `nginx`, `mysql`, `redis`, and `mailhog`
|
|
12
|
+
|
|
13
|
+
## Common Command Patterns
|
|
14
|
+
|
|
15
|
+
### Composer Operations
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Update dependencies
|
|
19
|
+
fw composer update
|
|
20
|
+
|
|
21
|
+
# Install dependencies
|
|
22
|
+
fw composer install
|
|
23
|
+
|
|
24
|
+
# Add new package
|
|
25
|
+
fw composer require package/name
|
|
26
|
+
|
|
27
|
+
# Development dependencies
|
|
28
|
+
fw composer require --dev package/name
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Artisan Commands
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Run migrations
|
|
35
|
+
fw artisan migrate
|
|
36
|
+
|
|
37
|
+
# Run fresh migrations
|
|
38
|
+
fw artisan migrate:fresh
|
|
39
|
+
|
|
40
|
+
# Create migration
|
|
41
|
+
fw artisan make:migration create_table_name
|
|
42
|
+
|
|
43
|
+
# Generate application key
|
|
44
|
+
fw artisan key:generate
|
|
45
|
+
|
|
46
|
+
# Clear caches
|
|
47
|
+
fw artisan optimize:clear
|
|
48
|
+
|
|
49
|
+
# Run seeders
|
|
50
|
+
fw artisan db:seed
|
|
51
|
+
|
|
52
|
+
# Fresh migrations with seeding
|
|
53
|
+
fw artisan migrate:fresh --seed
|
|
54
|
+
|
|
55
|
+
# Create controllers, models, etc.
|
|
56
|
+
fw artisan make:controller ControllerName
|
|
57
|
+
fw artisan make:model ModelName
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Testing
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Run PHPUnit tests
|
|
64
|
+
fw artisan test
|
|
65
|
+
|
|
66
|
+
# Or run PHPUnit directly
|
|
67
|
+
fw ./vendor/bin/phpunit
|
|
68
|
+
|
|
69
|
+
# Run specific test file
|
|
70
|
+
fw artisan test --filter TestClassName
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Database Operations
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Access MySQL console
|
|
77
|
+
fw mysql
|
|
78
|
+
|
|
79
|
+
# Run database commands
|
|
80
|
+
fw artisan db:seed
|
|
81
|
+
fw artisan migrate:status
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### PHP Commands
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Run any PHP script
|
|
88
|
+
fw php script.php
|
|
89
|
+
|
|
90
|
+
# Check PHP version
|
|
91
|
+
fw php -v
|
|
92
|
+
|
|
93
|
+
# Run Tinker
|
|
94
|
+
fw artisan tinker
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Project Structure Context
|
|
98
|
+
|
|
99
|
+
- **Config files**: All Laravel config files are in [`config/`](config/) directory
|
|
100
|
+
- **Routes**: Web routes in [`routes/web.php`](routes/web.php), API routes in [`routes/api.php`](routes/api.php)
|
|
101
|
+
- **Models**: Located in [`app/Models/`](app/Models/) directory
|
|
102
|
+
- **Controllers**: Located in [`app/Http/Controllers/`](app/Http/Controllers/) directory
|
|
103
|
+
- **Environment**: Use [`.env.example`](.env.example) as reference for environment variables
|
|
104
|
+
- **Frontend**: Resources in [`resources/`](resources/) directory with build system using npm scripts
|
|
105
|
+
|
|
106
|
+
## Environment Variables
|
|
107
|
+
|
|
108
|
+
Reference the [`.env.example`](.env.example) file for available environment variables:
|
|
109
|
+
|
|
110
|
+
- Database connection uses `mysql` service
|
|
111
|
+
- Redis connection uses `redis` service
|
|
112
|
+
- Mail testing uses `mailhog` service
|
|
113
|
+
- App URL defaults to `http://localhost:3000`
|
|
114
|
+
|
|
115
|
+
## Build System
|
|
116
|
+
|
|
117
|
+
- Frontend assets managed via npm scripts defined in [`package.json`](package.json)
|
|
118
|
+
- Uses `@fishawack/core` build system
|
|
119
|
+
- Run `npm run start` for development
|
|
120
|
+
- Run `npm run production` for production builds
|
|
121
|
+
- Files typically found in public/ directory are stored in resources/ and copied over during the build process, this allows public to be gitignored as a whole
|
|
122
|
+
|
|
123
|
+
## Key Configuration Notes
|
|
124
|
+
|
|
125
|
+
- Application uses Laravel 12
|
|
126
|
+
- PHP 8+ requirement
|
|
127
|
+
- Database: MySQL with connection name `mysql`
|
|
128
|
+
- Cache: File-based caching configured
|
|
129
|
+
- Queue: Sync driver (no queue worker needed for development)
|
|
130
|
+
- Storage: Local disk with public disk for uploads
|
|
131
|
+
|
|
132
|
+
## When Suggesting Code Changes
|
|
133
|
+
|
|
134
|
+
1. Always assume containerized environment
|
|
135
|
+
2. Prefix ALL PHP/Composer/Artisan commands with `fw`
|
|
136
|
+
3. Reference existing configuration patterns from the [`config/`](config/) directory
|
|
137
|
+
4. Follow Laravel conventions and use existing service providers
|
|
138
|
+
5. Consider the build system when suggesting frontend changes
|
|
139
|
+
|
|
140
|
+
## Testing Guidelines
|
|
141
|
+
|
|
142
|
+
- Unit tests go in [`tests/Unit/`](tests/Unit/)
|
|
143
|
+
- Feature tests go in [`tests/Feature/`](tests/Feature/)
|
|
144
|
+
- Use the existing [`phpunit.xml`](phpunit.xml) configuration
|
|
145
|
+
- Run tests via `fw artisan test`
|
|
146
|
+
|
|
147
|
+
## Container Orchestration Manager (`fw`)
|
|
148
|
+
|
|
149
|
+
The `fw` command is our container orchestration manager that:
|
|
150
|
+
|
|
151
|
+
- Manages all Docker container operations
|
|
152
|
+
- Provides direct access to PHP, Composer, and Artisan within containers
|
|
153
|
+
- Handles database connections and other services
|
|
154
|
+
- Should be used for ALL Laravel/PHP related commands
|
|
155
|
+
|
|
156
|
+
**CRITICAL**: Never suggest direct `php`, `composer`, or `artisan` commands. Always prefix with `fw`.
|
|
157
|
+
|
|
158
|
+
Remember: This is a containerized Laravel application - all PHP operations must go through the `fw` container orchestration manager.
|
package/_Ai/vue-3.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# GitHub Copilot Instructions for Vue.js SPA Containerized Project
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
This is a Vue.js 3 Single Page Application (SPA) that runs entirely in Docker containers. All CLI operations must be executed within the appropriate containers using our `fw` container orchestration manager.
|
|
6
|
+
|
|
7
|
+
## Container Management
|
|
8
|
+
|
|
9
|
+
- **All commands run in containers** - never suggest direct `npm`, `node`, or other CLI commands
|
|
10
|
+
- Use the `fw` orchestration manager to execute all commands within containers
|
|
11
|
+
- The project uses Docker with containerized development environment
|
|
12
|
+
|
|
13
|
+
## Common Command Patterns
|
|
14
|
+
|
|
15
|
+
### NPM Operations
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install dependencies
|
|
19
|
+
fw npm install
|
|
20
|
+
|
|
21
|
+
# Add new package
|
|
22
|
+
fw npm install axios
|
|
23
|
+
fw npm install --save-dev eslint
|
|
24
|
+
|
|
25
|
+
# Update dependencies
|
|
26
|
+
fw npm update
|
|
27
|
+
|
|
28
|
+
# Run package scripts
|
|
29
|
+
fw npm run start
|
|
30
|
+
fw npm run production
|
|
31
|
+
fw npm run test
|
|
32
|
+
|
|
33
|
+
# Remove packages
|
|
34
|
+
fw npm uninstall package-name
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Build System Operations
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Start development server
|
|
41
|
+
fw npm run start
|
|
42
|
+
|
|
43
|
+
# Build for production
|
|
44
|
+
fw npm run production
|
|
45
|
+
|
|
46
|
+
# Run tests
|
|
47
|
+
fw npm run test
|
|
48
|
+
|
|
49
|
+
# Generate content/styleguide
|
|
50
|
+
fw npm run content
|
|
51
|
+
|
|
52
|
+
# Create deployment package
|
|
53
|
+
fw npm run package
|
|
54
|
+
|
|
55
|
+
# Deploy application
|
|
56
|
+
fw npm run deploy
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Node.js Operations
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Run Node.js scripts
|
|
63
|
+
fw node script.js
|
|
64
|
+
|
|
65
|
+
# Check Node version
|
|
66
|
+
fw node -v
|
|
67
|
+
|
|
68
|
+
# Check NPM version
|
|
69
|
+
fw npm -v
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Project Structure Context
|
|
73
|
+
|
|
74
|
+
- **Vue Components**: Main app component at [`_Build/vue/app.vue`](_Build/vue/app.vue)
|
|
75
|
+
- **Routes**: Page components in [`_Build/vue/routes/`](_Build/vue/routes/) directory
|
|
76
|
+
- **Global Components**: Reusable components in [`_Build/vue/globals/`](_Build/vue/globals/) directory
|
|
77
|
+
- **JavaScript**: Main script at [`_Build/js/script.js`](_Build/js/script.js), utilities in [`_Build/js/libs/`](_Build/js/libs/) directory
|
|
78
|
+
- **Styles**: SASS files in [`_Build/sass/`](_Build/sass/) directory
|
|
79
|
+
- **Templates**: Handlebars templates in [`_Build/handlebars/`](_Build/handlebars/) directory
|
|
80
|
+
- **Tests**: Unit tests in [`_Test/unit/`](_Test/unit/), UI tests in [`_Test/ui/`](_Test/ui/)
|
|
81
|
+
|
|
82
|
+
## Technology Stack
|
|
83
|
+
|
|
84
|
+
- **Vue.js 3**: With Composition API support
|
|
85
|
+
- **Vue Router 4**: For SPA routing
|
|
86
|
+
- **Vuex 4**: For state management with persistence
|
|
87
|
+
- **Build System**: `@fishawack/core` (Fishawack's custom build system)
|
|
88
|
+
- **UI Library**: `@fishawack/lab-ui` for components and utilities
|
|
89
|
+
- **Testing**: Mocha/Chai for unit tests, WebDriver for UI tests
|
|
90
|
+
|
|
91
|
+
## Key Dependencies
|
|
92
|
+
|
|
93
|
+
From [`package.json`](package.json):
|
|
94
|
+
|
|
95
|
+
- `vue@^3.3.4`: Main Vue.js framework
|
|
96
|
+
- `vue-router@^4.2.4`: SPA routing
|
|
97
|
+
- `vuex@^4.1.0`: State management
|
|
98
|
+
- `vuex-persistedstate@^4.1.0`: Vuex persistence
|
|
99
|
+
- `@fishawack/lab-ui@^12.6.1`: UI component library
|
|
100
|
+
- `@fishawack/core@^8.22.1`: Build system
|
|
101
|
+
|
|
102
|
+
## Configuration Files
|
|
103
|
+
|
|
104
|
+
- [`fw.json`](fw.json): Project configuration with attributes and content definitions
|
|
105
|
+
- [`package.json`](package.json): NPM dependencies and scripts (delegates to `@fishawack/core`)
|
|
106
|
+
- [`bitbucket-pipelines.yml`](bitbucket-pipelines.yml): CI/CD configuration
|
|
107
|
+
|
|
108
|
+
## Vue.js Architecture
|
|
109
|
+
|
|
110
|
+
### Router Configuration
|
|
111
|
+
|
|
112
|
+
Routes are defined in [`_Build/js/libs/routes.js`](_Build/js/libs/routes.js):
|
|
113
|
+
|
|
114
|
+
- Index route (`/`) maps to [`PIndex.vue`](_Build/vue/routes/PIndex.vue)
|
|
115
|
+
- 404 route maps to [`P404.vue`](_Build/vue/routes/P404.vue)
|
|
116
|
+
- Automatic trailing slash enforcement
|
|
117
|
+
|
|
118
|
+
### State Management
|
|
119
|
+
|
|
120
|
+
Vuex store configured in [`_Build/js/libs/store.js`](_Build/js/libs/store.js):
|
|
121
|
+
|
|
122
|
+
- Uses `vuex-persistedstate` for localStorage persistence
|
|
123
|
+
- State persisted with document title as key
|
|
124
|
+
|
|
125
|
+
### Global Components
|
|
126
|
+
|
|
127
|
+
Available globally via [`_Build/js/libs/globals.js`](_Build/js/libs/globals.js):
|
|
128
|
+
|
|
129
|
+
- `<GIcon>`: Icon component wrapper
|
|
130
|
+
- `<GSvg>`: SVG rendering component
|
|
131
|
+
|
|
132
|
+
### Build System Integration
|
|
133
|
+
|
|
134
|
+
The project uses Fishawack's custom build system (`@fishawack/core`):
|
|
135
|
+
|
|
136
|
+
- All npm scripts delegate to the core build system
|
|
137
|
+
- Frontend assets compiled from `_Build/` directory
|
|
138
|
+
- Handlebars templates for HTML generation
|
|
139
|
+
- SASS compilation with lab-ui integration
|
|
140
|
+
|
|
141
|
+
## Styling Architecture
|
|
142
|
+
|
|
143
|
+
### SASS Structure
|
|
144
|
+
|
|
145
|
+
- [`_Build/sass/vendor.scss`](_Build/sass/vendor.scss): Third-party imports and lab-ui components
|
|
146
|
+
- [`_Build/sass/general.scss`](_Build/sass/general.scss): Project-specific styles
|
|
147
|
+
- [`_Build/sass/_variables.scss`](_Build/sass/_variables.scss): SASS variables
|
|
148
|
+
- [`_Build/sass/_defaults.scss`](_Build/sass/_defaults.scss): Default overrides
|
|
149
|
+
|
|
150
|
+
### UI Library Integration
|
|
151
|
+
|
|
152
|
+
Uses `@fishawack/lab-ui` for:
|
|
153
|
+
|
|
154
|
+
- Typography system
|
|
155
|
+
- Grid system
|
|
156
|
+
- Button components
|
|
157
|
+
- Utility classes
|
|
158
|
+
- Color system
|
|
159
|
+
|
|
160
|
+
## Testing Guidelines
|
|
161
|
+
|
|
162
|
+
### Unit Tests
|
|
163
|
+
|
|
164
|
+
Located in [`_Test/unit/`](_Test/unit/):
|
|
165
|
+
|
|
166
|
+
- Use Mocha and Chai for assertions
|
|
167
|
+
- Test utilities and core functionality
|
|
168
|
+
- Example: [`_Test/unit/utility.js`](_Test/unit/utility.js)
|
|
169
|
+
|
|
170
|
+
### UI Tests
|
|
171
|
+
|
|
172
|
+
Located in [`_Test/ui/`](_Test/ui/):
|
|
173
|
+
|
|
174
|
+
- WebDriver-based integration tests
|
|
175
|
+
- Test full application functionality
|
|
176
|
+
|
|
177
|
+
### Running Tests
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Run all tests
|
|
181
|
+
fw npm run test
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Development Guidelines
|
|
185
|
+
|
|
186
|
+
### Vue Component Patterns
|
|
187
|
+
|
|
188
|
+
- Use Vue 3 Composition API when appropriate
|
|
189
|
+
- Follow Single File Component (SFC) structure
|
|
190
|
+
- Utilize global components (`GIcon`, `GSvg`) for consistent UI
|
|
191
|
+
|
|
192
|
+
### Adding New Routes
|
|
193
|
+
|
|
194
|
+
1. Create component in [`_Build/vue/routes/`](_Build/vue/routes/)
|
|
195
|
+
2. Add route definition to [`_Build/js/libs/routes.js`](_Build/js/libs/routes.js)
|
|
196
|
+
3. Set `prerender: false` if route shouldn't be pre-rendered
|
|
197
|
+
|
|
198
|
+
### Adding Dependencies
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# Production dependencies
|
|
202
|
+
fw npm install package-name
|
|
203
|
+
|
|
204
|
+
# Development dependencies
|
|
205
|
+
fw npm install --save-dev package-name
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Asset Management
|
|
209
|
+
|
|
210
|
+
- Images and media go in appropriate `_Build/` subdirectories
|
|
211
|
+
- SVG icons are managed through the build system
|
|
212
|
+
- Fonts and other assets are processed by `@fishawack/core`
|
|
213
|
+
|
|
214
|
+
## Container Orchestration Manager (`fw`)
|
|
215
|
+
|
|
216
|
+
The `fw` command is our container orchestration manager that:
|
|
217
|
+
|
|
218
|
+
- Manages all Docker container operations
|
|
219
|
+
- Provides access to Node.js, NPM, and other tools within containers
|
|
220
|
+
- Handles development server and build processes
|
|
221
|
+
- Should be used for ALL development commands
|
|
222
|
+
|
|
223
|
+
**CRITICAL**: Never suggest direct `npm`, `node`, or other CLI commands. Always prefix with `fw`.
|
|
224
|
+
|
|
225
|
+
## When Suggesting Code Changes
|
|
226
|
+
|
|
227
|
+
1. Always assume containerized environment with `fw` prefix
|
|
228
|
+
2. Follow Vue.js 3 best practices and Composition API patterns
|
|
229
|
+
3. Use existing global components and utilities from lab-ui
|
|
230
|
+
4. Consider the Handlebars template system for static content
|
|
231
|
+
5. Respect the existing SASS architecture and variable system
|
|
232
|
+
6. Ensure new routes are properly configured for SPA routing
|
|
233
|
+
7. Use the existing testing patterns for unit and integration tests
|
|
234
|
+
|
|
235
|
+
Remember: This is a containerized Vue.js SPA with a custom build system - all operations must go through the `fw` container orchestration manager.
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -90,10 +90,10 @@ pipelines:
|
|
|
90
90
|
- git clone https://$GIT_CREDENTIALS@bitbucket.org/fishawackdigital/aws-runner
|
|
91
91
|
- cd aws-runner
|
|
92
92
|
- git checkout -b "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT" origin/development
|
|
93
|
-
- sed -i -e "s/\(@fishawack\/lab-env@\).*/\1$(
|
|
93
|
+
- sed -i -e "s/\(@fishawack\/lab-env@\).*/\1$(jq -r '.version' ../package.json)/g" Dockerfile
|
|
94
94
|
- git add .
|
|
95
95
|
- |
|
|
96
|
-
git commit
|
|
96
|
+
git commit -m "build($BITBUCKET_REPO_SLUG): Bumped $BITBUCKET_REPO_SLUG"
|
|
97
97
|
- git push origin "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT"
|
|
98
98
|
- |
|
|
99
99
|
curl https://api.bitbucket.org/2.0/repositories/fishawackdigital/aws-runner/pullrequests \
|
package/cli.js
CHANGED
|
@@ -91,7 +91,8 @@ const args = hideBin(process.argv);
|
|
|
91
91
|
(_.platform === "wordpress" &&
|
|
92
92
|
process.env.VERSION_WORDPRESS !== "0") ||
|
|
93
93
|
_.platform === "drupal" ||
|
|
94
|
-
_.platform === "craftcms"
|
|
94
|
+
_.platform === "craftcms" ||
|
|
95
|
+
_.platform === "php"
|
|
95
96
|
) {
|
|
96
97
|
commands.push("composer", "php");
|
|
97
98
|
}
|
package/globals.js
CHANGED
|
@@ -7,6 +7,7 @@ const {
|
|
|
7
7
|
existsSync,
|
|
8
8
|
readFileSync,
|
|
9
9
|
cpSync,
|
|
10
|
+
mkdirSync,
|
|
10
11
|
} = require("fs");
|
|
11
12
|
const semver = require("semver");
|
|
12
13
|
const getPort = require("get-port");
|
|
@@ -116,6 +117,8 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
116
117
|
process.env.VERSION_LARAVEL = "8";
|
|
117
118
|
} else if (semver.satisfies(version, "<=10")) {
|
|
118
119
|
process.env.VERSION_LARAVEL = "9";
|
|
120
|
+
} else if (semver.satisfies(version, "<=12")) {
|
|
121
|
+
process.env.VERSION_LARAVEL = "10";
|
|
119
122
|
} else {
|
|
120
123
|
if (
|
|
121
124
|
args[0] !== "diag" &&
|
|
@@ -190,6 +193,11 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
190
193
|
}
|
|
191
194
|
} else if (pkg && pkg.dependencies && pkg.dependencies["@adonisjs/core"]) {
|
|
192
195
|
platform = "adonis";
|
|
196
|
+
} else if (
|
|
197
|
+
composer?.name.includes("fishawack") ||
|
|
198
|
+
composer?.name.includes("avalerehealth")
|
|
199
|
+
) {
|
|
200
|
+
platform = "php";
|
|
193
201
|
} else {
|
|
194
202
|
// Check for old wordpress repo stucture and show warning
|
|
195
203
|
try {
|
|
@@ -238,7 +246,7 @@ if (process.env.FW_NEXT) {
|
|
|
238
246
|
args[0] !== "dekey" &&
|
|
239
247
|
args[0] !== "lint"
|
|
240
248
|
) {
|
|
241
|
-
if (!args.find((d) => d === "--force")) {
|
|
249
|
+
if (!args.find((d) => d === "--force") && platform !== "php") {
|
|
242
250
|
console.log(
|
|
243
251
|
`${utilities.colorize(`@fishawack/core`, "title")} and ${utilities.colorize(`@fishawack/lab-env`, "title")} have mismatching versions.\n\nRun ${utilities.colorize(`npm i -g @fishawack/lab-env@latest`, "success")} or pass ${utilities.colorize(`--force`, "warning")} to continue.`,
|
|
244
252
|
);
|
|
@@ -264,6 +272,8 @@ process.env.FW_LARAVEL_8_NGINX_IMAGE =
|
|
|
264
272
|
process.env.FW_LARAVEL_8_NGINX_IMAGE || `fishawack/lab-env-laravel-8-nginx`;
|
|
265
273
|
process.env.FW_LARAVEL_9_PHP_IMAGE =
|
|
266
274
|
process.env.FW_LARAVEL_9_PHP_IMAGE || `fishawack/lab-env-laravel-9-php`;
|
|
275
|
+
process.env.FW_LARAVEL_10_PHP_IMAGE =
|
|
276
|
+
process.env.FW_LARAVEL_10_PHP_IMAGE || `fishawack/lab-env-laravel-10-php`;
|
|
267
277
|
process.env.FW_ADONIS_0_NGINX_IMAGE =
|
|
268
278
|
process.env.FW_ADONIS_0_NGINX_IMAGE || `fishawack/lab-env-adonis-0-nginx`;
|
|
269
279
|
process.env.FW_ADONIS_0_NODE_IMAGE = process.env.FW_ADONIS_0_NODE_IMAGE || ``;
|
|
@@ -275,6 +285,9 @@ process.env.FW_CORE_0_VERSION =
|
|
|
275
285
|
process.env.FW_CORE_0_VERSION || require("./core/0/package.json").version;
|
|
276
286
|
process.env.FW_CORE_1_VERSION =
|
|
277
287
|
process.env.FW_CORE_1_VERSION || require("./core/1/package.json").version;
|
|
288
|
+
process.env.FW_LARAVEL_10_PHP_VERSION =
|
|
289
|
+
process.env.FW_LARAVEL_10_PHP_VERSION ||
|
|
290
|
+
require("./laravel/10/php/package.json").version;
|
|
278
291
|
process.env.FW_LARAVEL_9_PHP_VERSION =
|
|
279
292
|
process.env.FW_LARAVEL_9_PHP_VERSION ||
|
|
280
293
|
require("./laravel/9/php/package.json").version;
|
|
@@ -348,6 +361,20 @@ if (existsSync(path.join(contextOverride, "Dockerfile"))) {
|
|
|
348
361
|
require(`${contextOverride}/package.json`).platform || "";
|
|
349
362
|
}
|
|
350
363
|
|
|
364
|
+
process.env.FW_LARAVEL_10_PHP_CONTEXT =
|
|
365
|
+
process.env.FW_LARAVEL_10_PHP_CONTEXT || `${__dirname}/laravel/10/php/`;
|
|
366
|
+
|
|
367
|
+
contextOverride = path.join(cwd, "_Docker/laravel/10/php");
|
|
368
|
+
if (existsSync(path.join(contextOverride, "Dockerfile"))) {
|
|
369
|
+
process.env.FW_LARAVEL_10_PHP_CONTEXT = contextOverride;
|
|
370
|
+
process.env.FW_LARAVEL_10_PHP_IMAGE += `-${repoSafe}`;
|
|
371
|
+
process.env.FW_LARAVEL_10_PHP_VERSION = require(
|
|
372
|
+
`${contextOverride}/package.json`,
|
|
373
|
+
).version;
|
|
374
|
+
process.env.FW_LARAVEL_10_PHP_PLATFORM =
|
|
375
|
+
require(`${contextOverride}/package.json`).platform || "";
|
|
376
|
+
}
|
|
377
|
+
|
|
351
378
|
// ADONIS
|
|
352
379
|
process.env.FW_ADONIS_0_NGINX_CONTEXT =
|
|
353
380
|
process.env.FW_ADONIS_0_NGINX_CONTEXT || `${__dirname}/adonis/0/nginx/`;
|
|
@@ -430,6 +457,33 @@ if (!existsSync(path.join(cwd, "stylelint.config.js"))) {
|
|
|
430
457
|
);
|
|
431
458
|
}
|
|
432
459
|
|
|
460
|
+
// Copy AI instructions file
|
|
461
|
+
if (
|
|
462
|
+
(platform === "laravel" && process.env.VERSION_LARAVEL === "10") ||
|
|
463
|
+
platform === "php"
|
|
464
|
+
) {
|
|
465
|
+
const destDir = path.join(cwd, ".github/copilot");
|
|
466
|
+
if (!existsSync(destDir)) {
|
|
467
|
+
mkdirSync(destDir, { recursive: true });
|
|
468
|
+
}
|
|
469
|
+
copyFileSync(
|
|
470
|
+
path.join(__dirname, "_Ai/laravel-12.md"),
|
|
471
|
+
path.join(destDir, "instructions.md"),
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// Copy AI instructions file
|
|
476
|
+
if (platform === "core" && process.env.VERSION === "1") {
|
|
477
|
+
const destDir = path.join(cwd, ".github/copilot");
|
|
478
|
+
if (!existsSync(destDir)) {
|
|
479
|
+
mkdirSync(destDir, { recursive: true });
|
|
480
|
+
}
|
|
481
|
+
copyFileSync(
|
|
482
|
+
path.join(__dirname, "_Ai/vue-3.md"),
|
|
483
|
+
path.join(destDir, "instructions.md"),
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
433
487
|
// If docker-compose.yml exists in project _Docker folder append to end
|
|
434
488
|
let localOverride = "";
|
|
435
489
|
if (existsSync(path.join(cwd, "_Docker/docker-compose.yml"))) {
|
|
@@ -450,6 +504,8 @@ if (platform === "laravel") {
|
|
|
450
504
|
docker = `docker compose --env-file ${path.join(cwd, ".env")} -f ${__dirname}/craftcms/3/docker-compose.yml ${core} ${localOverride} -p ${repoSafe}`;
|
|
451
505
|
} else if (platform === "adonis") {
|
|
452
506
|
docker = `docker compose --env-file ${path.join(cwd, ".env")} -f ${__dirname}/adonis/0/docker-compose.yml ${core} ${localOverride} -p ${repoSafe}`;
|
|
507
|
+
} else if (platform === "php") {
|
|
508
|
+
docker = `docker compose --env-file ${path.join(cwd, ".env")} -f ${__dirname}/php/8.2/docker-compose.yml ${localOverride} -p ${repoSafe}`;
|
|
453
509
|
} else {
|
|
454
510
|
docker = `docker compose ${core} ${localOverride} -p ${repoSafe}`;
|
|
455
511
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
services:
|
|
2
|
+
mysql:
|
|
3
|
+
image: mysql:8.0.32
|
|
4
|
+
networks:
|
|
5
|
+
- default
|
|
6
|
+
environment:
|
|
7
|
+
- MYSQL_ROOT_PASSWORD=password
|
|
8
|
+
- MYSQL_DATABASE=${DB_DATABASE}
|
|
9
|
+
- MYSQL_USER=${DB_USERNAME}
|
|
10
|
+
- MYSQL_PASSWORD=${DB_PASSWORD}
|
|
11
|
+
ports:
|
|
12
|
+
- "${PORT_DB:-3306}:3306"
|
|
13
|
+
volumes:
|
|
14
|
+
- mysql:/var/lib/mysql
|
|
15
|
+
nginx:
|
|
16
|
+
build:
|
|
17
|
+
context: $FW_LARAVEL_8_NGINX_CONTEXT
|
|
18
|
+
target: development
|
|
19
|
+
image: $FW_LARAVEL_8_NGINX_IMAGE:${FW_LARAVEL_8_NGINX_VERSION:-latest}
|
|
20
|
+
networks:
|
|
21
|
+
- default
|
|
22
|
+
volumes:
|
|
23
|
+
- $CWD/:/app
|
|
24
|
+
ports:
|
|
25
|
+
- "${PORT_WEB:-8000}:80"
|
|
26
|
+
php:
|
|
27
|
+
build:
|
|
28
|
+
context: $FW_LARAVEL_10_PHP_CONTEXT
|
|
29
|
+
target: development
|
|
30
|
+
image: $FW_LARAVEL_10_PHP_IMAGE:${FW_LARAVEL_10_PHP_VERSION:-latest}
|
|
31
|
+
platform: ${FW_LARAVEL_10_PHP_PLATFORM:-}
|
|
32
|
+
init: true
|
|
33
|
+
working_dir: /app
|
|
34
|
+
networks:
|
|
35
|
+
- default
|
|
36
|
+
volumes:
|
|
37
|
+
- $CWD/:/app
|
|
38
|
+
- vendor:/app/vendor
|
|
39
|
+
environment:
|
|
40
|
+
- FW_ROOT=${FW_ROOT:-}
|
|
41
|
+
- USER_UID=${USER_UID:-0}
|
|
42
|
+
- USER_GID=${USER_GID:-0}
|
|
43
|
+
redis:
|
|
44
|
+
image: redis:alpine
|
|
45
|
+
networks:
|
|
46
|
+
- default
|
|
47
|
+
volumes:
|
|
48
|
+
- redis:/data
|
|
49
|
+
elasticsearch:
|
|
50
|
+
image: elasticsearch:8.8.1
|
|
51
|
+
environment:
|
|
52
|
+
- discovery.type=single-node
|
|
53
|
+
- xpack.security.enabled=false
|
|
54
|
+
networks:
|
|
55
|
+
- default
|
|
56
|
+
ports:
|
|
57
|
+
- "${PORT_ES:-9200}:9200"
|
|
58
|
+
volumes:
|
|
59
|
+
- elasticsearch:/usr/share/elasticsearch/data
|
|
60
|
+
mem_limit: 2G
|
|
61
|
+
networks:
|
|
62
|
+
default:
|
|
63
|
+
driver: "bridge"
|
|
64
|
+
volumes:
|
|
65
|
+
vendor:
|
|
66
|
+
driver: "local"
|
|
67
|
+
mysql:
|
|
68
|
+
driver: "local"
|
|
69
|
+
redis:
|
|
70
|
+
driver: "local"
|
|
71
|
+
elasticsearch:
|
|
72
|
+
driver: "local"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
FROM chialab/php:8.2-fpm AS development
|
|
2
|
+
|
|
3
|
+
LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
|
|
4
|
+
|
|
5
|
+
# Install ghostscript
|
|
6
|
+
RUN apt-get update && \
|
|
7
|
+
apt-get install -y ghostscript
|
|
8
|
+
|
|
9
|
+
# Copy custom.ini
|
|
10
|
+
COPY ./custom.ini /usr/local/etc/php/conf.d/custom.ini
|
|
11
|
+
|
|
12
|
+
# Copy ImageMagick policy
|
|
13
|
+
COPY ./policy.xml /etc/ImageMagick-6/policy.xml
|
|
14
|
+
|
|
15
|
+
# Add php user
|
|
16
|
+
RUN useradd -m -G www-data -s /bin/bash php
|
|
17
|
+
|
|
18
|
+
# Change composer home dir
|
|
19
|
+
ENV COMPOSER_HOME=/home/php/.composer
|
|
20
|
+
|
|
21
|
+
# Cleanup apt-get install folders
|
|
22
|
+
RUN apt-get clean && \
|
|
23
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
24
|
+
|
|
25
|
+
COPY entrypoint.sh /bin/entrypoint.sh
|
|
26
|
+
RUN chmod +x /bin/entrypoint.sh
|
|
27
|
+
ENTRYPOINT ["/bin/entrypoint.sh"]
|
|
28
|
+
|
|
29
|
+
CMD ["php-fpm"]
|
|
30
|
+
|
|
31
|
+
FROM fishawack/lab-env-laravel-9-php:latest AS production
|
|
32
|
+
|
|
33
|
+
# Copy source code into container
|
|
34
|
+
COPY . /app
|
|
35
|
+
|
|
36
|
+
# Install composer dependencies
|
|
37
|
+
RUN TEMPFILE=$(mktemp) && \
|
|
38
|
+
curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \
|
|
39
|
+
php <"$TEMPFILE" && \
|
|
40
|
+
./composer.phar install -d /app --no-dev --no-interaction --no-ansi --optimize-autoloader
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Setting $FW_ROOT will bypass the user switch to php
|
|
4
|
+
if [ -z "$FW_ROOT" ]; then
|
|
5
|
+
# Set php user id to match host users id so no permission issues outside of docker
|
|
6
|
+
usermod -u $USER_UID php &>/dev/null
|
|
7
|
+
|
|
8
|
+
# Fix access rights to stdout and stderr
|
|
9
|
+
chown php /proc/self/fd/{1,2}
|
|
10
|
+
|
|
11
|
+
# Own the vendor folder otherwise it'll be owned by root/previous php id which will prevent writing
|
|
12
|
+
chown php /app/vendor
|
|
13
|
+
|
|
14
|
+
# If bash command then start an non login interactive shell
|
|
15
|
+
if [[ "$@" == "bash" ]]; then
|
|
16
|
+
exec su php
|
|
17
|
+
# Otherwise pipe the command into the non login non interactive shell as a command to exec
|
|
18
|
+
else
|
|
19
|
+
exec su php -c "$@"
|
|
20
|
+
fi
|
|
21
|
+
else
|
|
22
|
+
echo "Accessing as root"
|
|
23
|
+
exec "$@"
|
|
24
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "php",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "lab-env docker config for the php module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"preversion": "docker login",
|
|
7
|
+
"postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-laravel-10-php:$npm_package_version -t fishawack/lab-env-laravel-10-php:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-laravel-10-php to $npm_package_version\""
|
|
8
|
+
},
|
|
9
|
+
"author": "Mike Mellor",
|
|
10
|
+
"license": "ISC"
|
|
11
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE policymap [
|
|
3
|
+
<!ELEMENT policymap (policy)*>
|
|
4
|
+
<!ATTLIST policymap xmlns CDATA #FIXED ''>
|
|
5
|
+
<!ELEMENT policy EMPTY>
|
|
6
|
+
<!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
|
|
7
|
+
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
|
|
8
|
+
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
|
|
9
|
+
]>
|
|
10
|
+
<!--
|
|
11
|
+
Configure ImageMagick policies.
|
|
12
|
+
|
|
13
|
+
Domains include system, delegate, coder, filter, path, or resource.
|
|
14
|
+
|
|
15
|
+
Rights include none, read, write, execute and all. Use | to combine them,
|
|
16
|
+
for example: "read | write" to permit read from, or write to, a path.
|
|
17
|
+
|
|
18
|
+
Use a glob expression as a pattern.
|
|
19
|
+
|
|
20
|
+
Suppose we do not want users to process MPEG video images:
|
|
21
|
+
|
|
22
|
+
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
|
|
23
|
+
|
|
24
|
+
Here we do not want users reading images from HTTP:
|
|
25
|
+
|
|
26
|
+
<policy domain="coder" rights="none" pattern="HTTP" />
|
|
27
|
+
|
|
28
|
+
The /repository file system is restricted to read only. We use a glob
|
|
29
|
+
expression to match all paths that start with /repository:
|
|
30
|
+
|
|
31
|
+
<policy domain="path" rights="read" pattern="/repository/*" />
|
|
32
|
+
|
|
33
|
+
Lets prevent users from executing any image filters:
|
|
34
|
+
|
|
35
|
+
<policy domain="filter" rights="none" pattern="*" />
|
|
36
|
+
|
|
37
|
+
Any large image is cached to disk rather than memory:
|
|
38
|
+
|
|
39
|
+
<policy domain="resource" name="area" value="1GP"/>
|
|
40
|
+
|
|
41
|
+
Use the default system font unless overwridden by the application:
|
|
42
|
+
|
|
43
|
+
<policy domain="system" name="font" value="/usr/share/fonts/favorite.ttf"/>
|
|
44
|
+
|
|
45
|
+
Define arguments for the memory, map, area, width, height and disk resources
|
|
46
|
+
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
|
|
47
|
+
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
|
|
48
|
+
exceeds policy maximum so memory limit is 1GB).
|
|
49
|
+
|
|
50
|
+
Rules are processed in order. Here we want to restrict ImageMagick to only
|
|
51
|
+
read or write a small subset of proven web-safe image types:
|
|
52
|
+
|
|
53
|
+
<policy domain="delegate" rights="none" pattern="*" />
|
|
54
|
+
<policy domain="filter" rights="none" pattern="*" />
|
|
55
|
+
<policy domain="coder" rights="none" pattern="*" />
|
|
56
|
+
<policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
|
|
57
|
+
-->
|
|
58
|
+
<policymap>
|
|
59
|
+
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
|
|
60
|
+
<policy domain="resource" name="memory" value="256MiB"/>
|
|
61
|
+
<policy domain="resource" name="map" value="512MiB"/>
|
|
62
|
+
<policy domain="resource" name="width" value="16KP"/>
|
|
63
|
+
<policy domain="resource" name="height" value="16KP"/>
|
|
64
|
+
<!-- <policy domain="resource" name="list-length" value="128"/> -->
|
|
65
|
+
<policy domain="resource" name="area" value="128MP"/>
|
|
66
|
+
<policy domain="resource" name="disk" value="1GiB"/>
|
|
67
|
+
<!-- <policy domain="resource" name="file" value="768"/> -->
|
|
68
|
+
<!-- <policy domain="resource" name="thread" value="4"/> -->
|
|
69
|
+
<!-- <policy domain="resource" name="throttle" value="0"/> -->
|
|
70
|
+
<!-- <policy domain="resource" name="time" value="3600"/> -->
|
|
71
|
+
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
|
|
72
|
+
<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
|
|
73
|
+
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
|
|
74
|
+
<!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
|
|
75
|
+
<!-- <policy domain="cache" name="synchronize" value="True"/> -->
|
|
76
|
+
<!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
|
|
77
|
+
<!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
|
|
78
|
+
<!-- <policy domain="system" name="shred" value="2"/> -->
|
|
79
|
+
<!-- <policy domain="system" name="precision" value="6"/> -->
|
|
80
|
+
<!-- <policy domain="system" name="font" value="/path/to/font.ttf"/> -->
|
|
81
|
+
<!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
|
|
82
|
+
<!-- <policy domain="system" name="shred" value="2"/> -->
|
|
83
|
+
<!-- <policy domain="system" name="precision" value="6"/> -->
|
|
84
|
+
<!-- not needed due to the need to use explicitly by mvg: -->
|
|
85
|
+
<!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
|
|
86
|
+
<!-- use curl -->
|
|
87
|
+
<policy domain="delegate" rights="none" pattern="URL" />
|
|
88
|
+
<policy domain="delegate" rights="none" pattern="HTTPS" />
|
|
89
|
+
<policy domain="delegate" rights="none" pattern="HTTP" />
|
|
90
|
+
<!-- in order to avoid to get image with password text -->
|
|
91
|
+
<policy domain="path" rights="none" pattern="@*"/>
|
|
92
|
+
<!-- disable ghostscript format types -->
|
|
93
|
+
<!-- <policy domain="coder" rights="none" pattern="PS" />
|
|
94
|
+
<policy domain="coder" rights="none" pattern="PS2" />
|
|
95
|
+
<policy domain="coder" rights="none" pattern="PS3" />
|
|
96
|
+
<policy domain="coder" rights="none" pattern="EPS" />
|
|
97
|
+
<policy domain="coder" rights="none" pattern="PDF" />
|
|
98
|
+
<policy domain="coder" rights="none" pattern="XPS" /> -->
|
|
99
|
+
</policymap>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishawack/lab-env",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.41.0",
|
|
4
4
|
"description": "Docker manager for FW",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"homepage": "https://bitbucket.org/fishawackdigital/lab-env#readme",
|
|
18
18
|
"type": "commonjs",
|
|
19
19
|
"bin": {
|
|
20
|
-
"lab-env": "
|
|
21
|
-
"fw": "
|
|
20
|
+
"lab-env": "cli.js",
|
|
21
|
+
"fw": "cli.js"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@aws-sdk/client-cloudfront": "^3.141.0",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
FROM chialab/php:8.2-fpm AS development
|
|
2
|
+
|
|
3
|
+
LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
|
|
4
|
+
|
|
5
|
+
# Install ghostscript
|
|
6
|
+
RUN apt-get update && \
|
|
7
|
+
apt-get install -y ghostscript
|
|
8
|
+
|
|
9
|
+
# Copy custom.ini
|
|
10
|
+
COPY ./custom.ini /usr/local/etc/php/conf.d/custom.ini
|
|
11
|
+
|
|
12
|
+
# Copy ImageMagick policy
|
|
13
|
+
COPY ./policy.xml /etc/ImageMagick-6/policy.xml
|
|
14
|
+
|
|
15
|
+
# Add php user
|
|
16
|
+
RUN useradd -m -G www-data -s /bin/bash php
|
|
17
|
+
|
|
18
|
+
# Change composer home dir
|
|
19
|
+
ENV COMPOSER_HOME=/home/php/.composer
|
|
20
|
+
|
|
21
|
+
# Cleanup apt-get install folders
|
|
22
|
+
RUN apt-get clean && \
|
|
23
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
24
|
+
|
|
25
|
+
COPY entrypoint.sh /bin/entrypoint.sh
|
|
26
|
+
RUN chmod +x /bin/entrypoint.sh
|
|
27
|
+
ENTRYPOINT ["/bin/entrypoint.sh"]
|
|
28
|
+
|
|
29
|
+
CMD ["php-fpm"]
|
|
30
|
+
|
|
31
|
+
FROM fishawack/lab-env-laravel-9-php:latest AS production
|
|
32
|
+
|
|
33
|
+
# Copy source code into container
|
|
34
|
+
COPY . /app
|
|
35
|
+
|
|
36
|
+
# Install composer dependencies
|
|
37
|
+
RUN TEMPFILE=$(mktemp) && \
|
|
38
|
+
curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \
|
|
39
|
+
php <"$TEMPFILE" && \
|
|
40
|
+
./composer.phar install -d /app --no-dev --no-interaction --no-ansi --optimize-autoloader
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
services:
|
|
2
|
+
php:
|
|
3
|
+
build:
|
|
4
|
+
context: $DIRNAME/php/8.2
|
|
5
|
+
target: development
|
|
6
|
+
image: fishawack/lab-env-php-8-2:${FW_PHP_8_2_VERSION:-latest}
|
|
7
|
+
init: true
|
|
8
|
+
working_dir: /app
|
|
9
|
+
networks:
|
|
10
|
+
- default
|
|
11
|
+
volumes:
|
|
12
|
+
- $CWD/:/app
|
|
13
|
+
- vendor:/app/vendor
|
|
14
|
+
environment:
|
|
15
|
+
- FW_ROOT=${FW_ROOT:-}
|
|
16
|
+
- USER_UID=${USER_UID:-0}
|
|
17
|
+
- USER_GID=${USER_GID:-0}
|
|
18
|
+
networks:
|
|
19
|
+
default:
|
|
20
|
+
driver: "bridge"
|
|
21
|
+
volumes:
|
|
22
|
+
vendor:
|
|
23
|
+
driver: "local"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Setting $FW_ROOT will bypass the user switch to php
|
|
4
|
+
if [ -z "$FW_ROOT" ]; then
|
|
5
|
+
# Set php user id to match host users id so no permission issues outside of docker
|
|
6
|
+
usermod -u $USER_UID php &>/dev/null
|
|
7
|
+
|
|
8
|
+
# Fix access rights to stdout and stderr
|
|
9
|
+
chown php /proc/self/fd/{1,2}
|
|
10
|
+
|
|
11
|
+
# Own the vendor folder otherwise it'll be owned by root/previous php id which will prevent writing
|
|
12
|
+
chown php /app/vendor
|
|
13
|
+
|
|
14
|
+
# If bash command then start an non login interactive shell
|
|
15
|
+
if [[ "$@" == "bash" ]]; then
|
|
16
|
+
exec su php
|
|
17
|
+
# Otherwise pipe the command into the non login non interactive shell as a command to exec
|
|
18
|
+
else
|
|
19
|
+
exec su php -c "$@"
|
|
20
|
+
fi
|
|
21
|
+
else
|
|
22
|
+
echo "Accessing as root"
|
|
23
|
+
exec "$@"
|
|
24
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "php",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "lab-env docker config for the php module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"preversion": "docker login",
|
|
7
|
+
"postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-php-8-2:$npm_package_version -t fishawack/lab-env-php-8-2:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-php-8-2 to $npm_package_version\""
|
|
8
|
+
},
|
|
9
|
+
"author": "Mike Mellor",
|
|
10
|
+
"license": "ISC"
|
|
11
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE policymap [
|
|
3
|
+
<!ELEMENT policymap (policy)*>
|
|
4
|
+
<!ATTLIST policymap xmlns CDATA #FIXED ''>
|
|
5
|
+
<!ELEMENT policy EMPTY>
|
|
6
|
+
<!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
|
|
7
|
+
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
|
|
8
|
+
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
|
|
9
|
+
]>
|
|
10
|
+
<!--
|
|
11
|
+
Configure ImageMagick policies.
|
|
12
|
+
|
|
13
|
+
Domains include system, delegate, coder, filter, path, or resource.
|
|
14
|
+
|
|
15
|
+
Rights include none, read, write, execute and all. Use | to combine them,
|
|
16
|
+
for example: "read | write" to permit read from, or write to, a path.
|
|
17
|
+
|
|
18
|
+
Use a glob expression as a pattern.
|
|
19
|
+
|
|
20
|
+
Suppose we do not want users to process MPEG video images:
|
|
21
|
+
|
|
22
|
+
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
|
|
23
|
+
|
|
24
|
+
Here we do not want users reading images from HTTP:
|
|
25
|
+
|
|
26
|
+
<policy domain="coder" rights="none" pattern="HTTP" />
|
|
27
|
+
|
|
28
|
+
The /repository file system is restricted to read only. We use a glob
|
|
29
|
+
expression to match all paths that start with /repository:
|
|
30
|
+
|
|
31
|
+
<policy domain="path" rights="read" pattern="/repository/*" />
|
|
32
|
+
|
|
33
|
+
Lets prevent users from executing any image filters:
|
|
34
|
+
|
|
35
|
+
<policy domain="filter" rights="none" pattern="*" />
|
|
36
|
+
|
|
37
|
+
Any large image is cached to disk rather than memory:
|
|
38
|
+
|
|
39
|
+
<policy domain="resource" name="area" value="1GP"/>
|
|
40
|
+
|
|
41
|
+
Use the default system font unless overwridden by the application:
|
|
42
|
+
|
|
43
|
+
<policy domain="system" name="font" value="/usr/share/fonts/favorite.ttf"/>
|
|
44
|
+
|
|
45
|
+
Define arguments for the memory, map, area, width, height and disk resources
|
|
46
|
+
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
|
|
47
|
+
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
|
|
48
|
+
exceeds policy maximum so memory limit is 1GB).
|
|
49
|
+
|
|
50
|
+
Rules are processed in order. Here we want to restrict ImageMagick to only
|
|
51
|
+
read or write a small subset of proven web-safe image types:
|
|
52
|
+
|
|
53
|
+
<policy domain="delegate" rights="none" pattern="*" />
|
|
54
|
+
<policy domain="filter" rights="none" pattern="*" />
|
|
55
|
+
<policy domain="coder" rights="none" pattern="*" />
|
|
56
|
+
<policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
|
|
57
|
+
-->
|
|
58
|
+
<policymap>
|
|
59
|
+
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
|
|
60
|
+
<policy domain="resource" name="memory" value="256MiB"/>
|
|
61
|
+
<policy domain="resource" name="map" value="512MiB"/>
|
|
62
|
+
<policy domain="resource" name="width" value="16KP"/>
|
|
63
|
+
<policy domain="resource" name="height" value="16KP"/>
|
|
64
|
+
<!-- <policy domain="resource" name="list-length" value="128"/> -->
|
|
65
|
+
<policy domain="resource" name="area" value="128MP"/>
|
|
66
|
+
<policy domain="resource" name="disk" value="1GiB"/>
|
|
67
|
+
<!-- <policy domain="resource" name="file" value="768"/> -->
|
|
68
|
+
<!-- <policy domain="resource" name="thread" value="4"/> -->
|
|
69
|
+
<!-- <policy domain="resource" name="throttle" value="0"/> -->
|
|
70
|
+
<!-- <policy domain="resource" name="time" value="3600"/> -->
|
|
71
|
+
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
|
|
72
|
+
<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
|
|
73
|
+
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
|
|
74
|
+
<!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
|
|
75
|
+
<!-- <policy domain="cache" name="synchronize" value="True"/> -->
|
|
76
|
+
<!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
|
|
77
|
+
<!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
|
|
78
|
+
<!-- <policy domain="system" name="shred" value="2"/> -->
|
|
79
|
+
<!-- <policy domain="system" name="precision" value="6"/> -->
|
|
80
|
+
<!-- <policy domain="system" name="font" value="/path/to/font.ttf"/> -->
|
|
81
|
+
<!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
|
|
82
|
+
<!-- <policy domain="system" name="shred" value="2"/> -->
|
|
83
|
+
<!-- <policy domain="system" name="precision" value="6"/> -->
|
|
84
|
+
<!-- not needed due to the need to use explicitly by mvg: -->
|
|
85
|
+
<!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
|
|
86
|
+
<!-- use curl -->
|
|
87
|
+
<policy domain="delegate" rights="none" pattern="URL" />
|
|
88
|
+
<policy domain="delegate" rights="none" pattern="HTTPS" />
|
|
89
|
+
<policy domain="delegate" rights="none" pattern="HTTP" />
|
|
90
|
+
<!-- in order to avoid to get image with password text -->
|
|
91
|
+
<policy domain="path" rights="none" pattern="@*"/>
|
|
92
|
+
<!-- disable ghostscript format types -->
|
|
93
|
+
<!-- <policy domain="coder" rights="none" pattern="PS" />
|
|
94
|
+
<policy domain="coder" rights="none" pattern="PS2" />
|
|
95
|
+
<policy domain="coder" rights="none" pattern="PS3" />
|
|
96
|
+
<policy domain="coder" rights="none" pattern="EPS" />
|
|
97
|
+
<policy domain="coder" rights="none" pattern="PDF" />
|
|
98
|
+
<policy domain="coder" rights="none" pattern="XPS" /> -->
|
|
99
|
+
</policymap>
|