Skip to content

Commit 7f10a84

Browse files
Finish initial docker configuration
1 parent 79f9e1c commit 7f10a84

File tree

3 files changed

+70
-10
lines changed

3 files changed

+70
-10
lines changed

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM php:8.2-cli
2+
3+
WORKDIR /var/www/html
4+
5+
RUN apt-get update && apt-get install -y \
6+
curl \
7+
libpng-dev \
8+
libjpeg-dev \
9+
libfreetype6-dev \
10+
libzip-dev \
11+
zip \
12+
unzip \
13+
nodejs \
14+
npm
15+
16+
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
17+
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
18+
19+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
20+
21+
COPY composer.json composer.lock ./
22+
23+
RUN composer install --no-scripts --no-autoloader
24+
25+
COPY . .
26+
27+
RUN composer dump-autoload
28+
29+
RUN apt-get update && apt-get install -y \
30+
nodejs \
31+
npm
32+
33+
RUN npm install
34+
35+
RUN php artisan config:clear
36+
37+
EXPOSE 9000
38+
39+
CMD php artisan serve --host=0.0.0.0 --port=9000
40+

config/database.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
| to use as your default connection for all database work. Of course
1414
| you may use many connections at once using the Database library.
1515
|
16-
*/
16+
*/
1717

1818
'default' => env('DB_CONNECTION', 'mysql'),
1919

@@ -31,7 +31,7 @@
3131
| so make sure you have the driver for your particular database of
3232
| choice installed on your machine before you begin development.
3333
|
34-
*/
34+
*/
3535

3636
'connections' => [
3737

@@ -46,11 +46,11 @@
4646
'mysql' => [
4747
'driver' => 'mysql',
4848
'url' => env('DATABASE_URL'),
49-
'host' => env('DB_HOST', '127.0.0.1'),
50-
'port' => env('DB_PORT', '3306'),
51-
'database' => env('DB_DATABASE', 'forge'),
52-
'username' => env('DB_USERNAME', 'forge'),
53-
'password' => env('DB_PASSWORD', ''),
49+
'host' => env('DB_HOST', 'mysql'),
50+
'port' => env('DB_PORT', '3307'),
51+
'database' => env('DB_DATABASE', 'application_database'),
52+
'username' => env('DB_USERNAME', 'root'),
53+
'password' => env('DB_PASSWORD', 'Expense.tracker.password_2024!'),
5454
'unix_socket' => env('DB_SOCKET', ''),
5555
'charset' => 'utf8mb4',
5656
'collation' => 'utf8mb4_unicode_ci',
@@ -104,7 +104,7 @@
104104
| your application. Using this information, we can determine which of
105105
| the migrations on disk haven't actually been run in the database.
106106
|
107-
*/
107+
*/
108108

109109
'migrations' => 'migrations',
110110

@@ -117,15 +117,15 @@
117117
| provides a richer body of commands than a typical key-value system
118118
| such as APC or Memcached. Laravel makes it easy to dig right in.
119119
|
120-
*/
120+
*/
121121

122122
'redis' => [
123123

124124
'client' => env('REDIS_CLIENT', 'phpredis'),
125125

126126
'options' => [
127127
'cluster' => env('REDIS_CLUSTER', 'redis'),
128-
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
128+
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
129129
],
130130

131131
'default' => [

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '3.8'
2+
3+
services:
4+
application:
5+
restart: always
6+
build:
7+
context: .
8+
dockerfile: Dockerfile
9+
ports:
10+
- "9000:9000"
11+
depends_on:
12+
- mysql
13+
14+
mysql:
15+
image: mysql:latest
16+
environment:
17+
MYSQL_DATABASE: LaravelInertiaVueSpa.Database_2024!
18+
MYSQL_ROOT_PASSWORD: LaravelInertiaVueSpa.Password_2024!
19+
ports:
20+
- "3307:3307"

0 commit comments

Comments
 (0)