Skip to content
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
2,143 changes: 1,164 additions & 979 deletions API/composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function up(): void
$table->boolean('can_delete')->default(false);

// Ensure the foreign key column allows null values
$table->unsignedBigInteger('shopping_list_id')->notNullable();
$table->integer('shopping_list_id')->unsigned()->notNullable();

// Set the foreign key constraint with onDelete behavior
$table->foreign('shopping_list_id')
Expand Down
37 changes: 37 additions & 0 deletions API/docker/development/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Use the official PHP 8.2 CLI image
FROM php:8.2-cli-alpine

# Set working directory
WORKDIR /var/www/html

# Install system dependencies
RUN apk add --no-cache \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql mbstring xml

# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql mbstring xml

# Install Composer globally
COPY --from=composer:2.6 /usr/bin/composer /usr/bin/composer

# Copy application source
COPY . /var/www/html

# Install dependencies
RUN composer install

# Set correct permissions
RUN chmod -R 777 storage bootstrap/cache

# Expose port 8000 for Laravel's dev server
EXPOSE 8000

# Start Laravel development server
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]
63 changes: 40 additions & 23 deletions API/docker/development/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
version: '3.8'

services:
nginx:
app:
build:
context: ../../ # Laravel Project root (API folder)
dockerfile: docker/development/nginx/Dockerfile
image: velocities/mynginx:latest # Use the remote image
volumes:
- /etc/letsencrypt:/etc/letsencrypt # Mount live certs into the container
- ./docker/development/nginx/conf.d:/etc/nginx/conf.d # Assuming your nginx configs are in ./docker/nginx/conf.d
- ./docker/development/nginx/snippets:/etc/nginx/snippets # If you have snippets to include
context: ../../
dockerfile: ./docker/development/Dockerfile
container_name: laravel_dev
ports:
- "8080:80" # Map host port 8080 to container port 80
- "8443:443" # Map host port 8443 to container port 443
- "8000:8000"
depends_on:
- app
app:
build:
context: ../../ # Laravel Project root (API folder)
dockerfile: docker/development/php/Dockerfile
image: velocities/myapp:latest # Use the remote image
- db
env_file:
- ../../.env
# Make sure the following variables are set in .env
# for the db connection to function properly:
# APP_ENV=local
# APP_DEBUG=true
# DB_CONNECTION=mysql
# DB_HOST=db
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=root
networks:
- laravel_network

db:
image: mysql:8.0
container_name: laravel_db
restart: always
environment:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: root
volumes:
- ./database:/var/www/SpeedCart/API/database
- ./storage:/var/www/SpeedCart/API/storage
- ./bootstrap/cache:/var/www/SpeedCart/API/bootstrap/cache
- ./:/var/www/SpeedCart/API # Mount your source code (should make container restart upon save to code)
restart: always # Ensures the container restarts automatically if it stops
expose:
- "9000"
- db_data:/var/lib/mysql
ports:
- "127.0.0.1:3306:3306"
networks:
- laravel_network

volumes:
db_data:

networks:
laravel_network:
driver: bridge
10 changes: 0 additions & 10 deletions API/docker/development/nginx/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions API/docker/development/nginx/conf.d/default.conf

This file was deleted.

5 changes: 0 additions & 5 deletions API/docker/development/nginx/snippets/fastcgi-php.conf

This file was deleted.

50 changes: 0 additions & 50 deletions API/docker/development/php/Dockerfile

This file was deleted.

Loading