diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4858104 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +version: '3.8' + +services: + web: + build: + context: . + dockerfile: Dockerfile + container_name: skunk-lounge-web + ports: + - "8000:80" + volumes: + - .:/var/www/html + depends_on: + - db + environment: + DB_CONNECTION: pgsql + DB_HOST: db + DB_PORT: 5432 + DB_DATABASE: skunk_lounge + DB_USERNAME: skunk_user + DB_PASSWORD: skunk_pass + APP_KEY: ${APP_KEY} + networks: + - skunk-net + + db: + image: postgres:16 + container_name: skunk-lounge-db + restart: always + ports: + - "5433:5432" + environment: + POSTGRES_DB: skunk_lounge + POSTGRES_USER: skunk_user + POSTGRES_PASSWORD: skunk_pass + volumes: + - db-data:/var/lib/postgresql/data + networks: + - skunk-net + + vite: + image: node:20 + container_name: skunk-lounge-vite + working_dir: /var/www/html + volumes: + - .:/var/www/html + command: npm run dev + ports: + - "5173:5173" + networks: + - skunk-net + +volumes: + db-data: + +networks: + skunk-net: + driver: bridge \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..9063fbc --- /dev/null +++ b/dockerfile @@ -0,0 +1,25 @@ +FROM php:8.3-fpm + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + libpq-dev \ + zip unzip \ + git \ + nodejs \ + npm \ + && docker-php-ext-install pdo pdo_pgsql + +# Install Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Set working directory +WORKDIR /var/www/html + +# Copy project files +COPY . . + +# Install dependencies +RUN composer install --no-dev --optimize-autoloader && npm install && npm run build + +EXPOSE 80 +CMD ["php-fpm"] \ No newline at end of file