Skip to content

Commit

Permalink
* Dependencies update
Browse files Browse the repository at this point in the history
* Remove npm Dockerfile and migrate its functionality to php Dockerfile

* Refactored text area into EventGenerationTextArea component

* Add restart policy to database in docker-compose files

* Update backup notification email recipient

* Added CACHE_STORE to GitHub workflow and .env.example
  • Loading branch information
hrsa authored May 12, 2024
1 parent 1ac8f1e commit 5818fe1
Show file tree
Hide file tree
Showing 33 changed files with 102 additions and 676 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BROADCAST_CONNECTION=reverb
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis

CACHE_STORE=database
CACHE_STORE=file
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
ADMIN_FIRSTNAME: ${{ secrets.ADMIN_FIRSTNAME }}
ADMIN_LASTNAME: ${{ secrets.ADMIN_LASTNAME }}
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
CACHE_STORE: ${{ secrets.CACHE_STORE }}
DB_DATABASE: ${{ secrets.DB_DATABASE }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
Expand Down Expand Up @@ -110,6 +111,7 @@ jobs:
ADMIN_FIRSTNAME: ${{ secrets.ADMIN_FIRSTNAME }}
ADMIN_LASTNAME: ${{ secrets.ADMIN_LASTNAME }}
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
CACHE_STORE: ${{ secrets.CACHE_STORE }}
DB_DATABASE: ${{ secrets.DB_DATABASE }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/jobs/build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ inputs:
required: true
ADMIN_EMAIL:
required: true
CACHE_STORE:
required: true
DB_DATABASE:
required: true
DB_USERNAME:
Expand Down Expand Up @@ -126,6 +128,7 @@ runs:
sed -i "s|ADMIN_FIRSTNAME=.*|ADMIN_FIRSTNAME=${{ inputs.ADMIN_FIRSTNAME }}|" .env
sed -i "s|ADMIN_LASTNAME=.*|ADMIN_LASTNAME=${{ inputs.ADMIN_LASTNAME }}|" .env
sed -i "s|ADMIN_EMAIL=.*|ADMIN_EMAIL=${{ inputs.ADMIN_EMAIL }}|" .env
sed -i "s|CACHE_STORE=.*|CACHE_STORE=${{ inputs.CACHE_STORE }}|" .env
sed -i "s|DB_DATABASE=.*|DB_DATABASE=${{ inputs.DB_DATABASE }}|" .env
sed -i "s|DB_USERNAME=.*|DB_USERNAME=${{ inputs.DB_USERNAME }}|" .env
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=${{ inputs.DB_PASSWORD }}|" .env
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.23.1",
"larastan/larastan": "^2.9.5",
"larastan/larastan": "^2.9.6",
"laravel/breeze": "^2.0.3",
"laravel/pint": "^1.15.3",
"laravel/sail": "^1.29.1",
Expand Down
26 changes: 13 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
'notifiable' => \Spatie\Backup\Notifications\Notifiable::class,

'mail' => [
'to' => '[email protected]',
'to' => env('ADMIN_EMAIL', null),

'from' => [
'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
Expand Down
5 changes: 3 additions & 2 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ services:

db:
image: postgres:latest
container_name: postgres
container_name: db
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
Expand Down Expand Up @@ -178,7 +179,7 @@ services:
npm:
build:
context: .
dockerfile: ./docker/npm.dockerfile
dockerfile: ./docker/php.dockerfile
target: npm
args:
- UID=${UID:-1001}
Expand Down
1 change: 1 addition & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ services:
db:
image: postgres:latest
container_name: db
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ services:

db:
image: postgres:latest
container_name: postgres
container_name: db
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
Expand Down Expand Up @@ -178,7 +179,7 @@ services:
npm:
build:
context: .
dockerfile: ./docker/npm.dockerfile
dockerfile: ./docker/php.dockerfile
target: npm
args:
- UID=${UID:-1001}
Expand All @@ -197,7 +198,7 @@ services:
ncu:
build:
context: .
dockerfile: ./docker/npm.dockerfile
dockerfile: ./docker/php.dockerfile
target: ncu
args:
- UID=${UID:-1001}
Expand Down
25 changes: 0 additions & 25 deletions docker/npm.dockerfile

This file was deleted.

10 changes: 9 additions & 1 deletion docker/php.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \

RUN curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
RUN apt-get install -y nodejs

RUN npm install -g [email protected] && npm install -g npm-check-updates
RUN chown -R ${UID}:${GID} /var/www
RUN chmod 777 -R /var/www
USER ${USER}

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
Expand All @@ -75,3 +77,9 @@ CMD /usr/bin/supervisord -u ${USER} -n -c /etc/supervisor/conf.d/supervisord-que

FROM base AS composer
ENTRYPOINT ["composer"]

FROM base as npm
ENTRYPOINT [ "npm" ]

FROM base as ncu
ENTRYPOINT [ "ncu", "--interactive", "--format", "group" ]
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"typescript": "^5.4.5",
"vite": "^5.2",
"vue": "^3.4.27",
"vue-tsc": "^2.0.16"
"vue-tsc": "^2.0.17"
},
"dependencies": {
"@formkit/vue": "^1.6.2",
Expand Down
37 changes: 37 additions & 0 deletions resources/js/Components/EventGenerationTextArea.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import TextArea from "@/Components/TextArea.vue";
import LoadingSpinner from "@/Components/LoadingSpinner.vue";
const model = defineModel<string>({ required: true });
const props = defineProps<{
loading?: boolean;
}>();
const getPlaceholder = (): string => {
const placeholderTexts: string[] = [
"Note to self:\nBuy anniversary gift for Sarah\nMay 20, 2024\nDon't forget to buy flowers too!!",
"Hotel Reservation Confirmation:\nGuest:\n- Name: Emily Johnson\n- Email: [email protected]\n- Phone: +1 (555) 987-6543\n\nReservation Details:\n- Check-in Date: June 20, 2024\n- Check-out Date: June 25, 2024\n- Number of Nights: 5\n- Room Type: Deluxe King Room\n- Number of Guests: 2\n- Special Requests: Non-smoking room, high floor\n\nHotel Information:\n- Hotel Name: Serenity Resort\n- Address: 123 Beachfront Avenue, Anytown, USA\n- Phone: +1 (555) 123-4567\n- Website: www.serenityresort.com",
"Appointment Confirmation:\n- Name: John Smith\n- Email: [email protected]\n- Phone: +1 (555) 123-4567\n\nAppointment Details:\n- Date: June 10, 2024\n- Time: 2:00 PM\n- Location: City Hall\n- Purpose: Property Tax Rebate",
"Concert Ticket Holder:\n- Name: Jane Smith\n- Email: [email protected]\n- Phone: +1 (555) 987-6543\n\nEvent Details:\n- Event: Summer Music Festival\n- Date: July 15, 2024\n- Time: 7:00 PM\n- Venue: Harmony Park Amphitheater\n- Location: Anytown, USA\n\nTicket Information:\n- Ticket Type: General Admission\n- Ticket Number: 123456789\n- Seat Number: N/A",
"Flight Details:\n- Departure Date: May 25, 2024\n- Departure Time: 10:00 AM\n- Departure Airport: JFK - John F. Kennedy International Airport\n- Arrival Date: May 30, 2024\n- Arrival Time: 3:00 PM\n- Arrival Airport: LAX - Los Angeles International Airport\n- Flight Number: XYZ123\n- Seat Number: 22A\n",
"Reminder to Self:\n Action: Schedule dentist appointment\nDate: May 15, 2024\nPriority: High\nLocation: Downtown Dental Clinic\nNote: Call to schedule appointment for annual check-up.",
"Hey there! How about dinner on Saturday? Let's meet at The Rustic Kitchen at 7:00 PM.\nAddress: 456 Oak Street, Anytown, USA.\nCan't wait to catch up!\n\nXOXO\nFred"
];
const index: number = Math.floor(Math.random() * placeholderTexts.length);
return placeholderTexts[index];
}
</script>

<template>
<div class="relative w-full h-48">
<TextArea class="h-48 w-full resize-none text-lg placeholder:text-sm" :class="props.loading ? 'blur-lg' : ''"
:placeholder="getPlaceholder()"
v-model="model"/>
<div v-if="props.loading"
role="status" class="absolute -translate-x-1/2 -translate-y-1/2 top-2/4 left-1/2">
<LoadingSpinner/>
</div>
</div>
</template>
Loading

0 comments on commit 5818fe1

Please sign in to comment.