Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ npm-debug.log
yarn-error.log
public/vendor/
/sandbox
.phpunit.cache/

test.db

Expand Down
76 changes: 8 additions & 68 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,75 +1,15 @@
FROM php:8.3-apache
FROM uspdev/uspdev-php-apache:8.4

ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i 's|/var/www/html|/var/www/html/public|' \
/etc/apache2/sites-available/000-default.conf

RUN apt-get update && apt-get install -y \
unixodbc \
unixodbc-dev \
freetds-dev \
freetds-bin \
tdsodbc \
libsybdb5 \
unzip \
git \
curl \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libonig-dev \
libxml2-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install \
pdo_mysql \
pdo_dblib \
gd \
mbstring \
zip \
xml \
bcmath \
pcntl \
opcache

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

RUN echo "[FreeTDS]" >> /etc/odbcinst.ini \
&& echo "Description = FreeTDS Driver" >> /etc/odbcinst.ini \
&& echo "Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so" >> /etc/odbcinst.ini \
&& echo "Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so" >> /etc/odbcinst.ini

RUN a2enmod rewrite

COPY dokku-deploy/apache-php.conf /etc/apache2/conf-available/
RUN a2enconf apache-php

RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!/var/www/html/public!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

COPY composer.json composer.lock ./
USER www-data
RUN composer install --no-interaction --no-dev --no-autoloader

WORKDIR /var/www/html

COPY composer.json composer.lock ./

RUN composer install --no-interaction --no-dev --no-autoloader

USER root
COPY --chown=www-data . .

RUN mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R 775 storage bootstrap/cache

USER www-data
RUN composer dump-autoload

EXPOSE 80
RUN composer install \
--no-dev \
--optimize-autoloader \
--no-interaction

CMD ["apache2-foreground"]
CMD ["apache2-foreground"]
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
"uspdev/wsfoto": "^2.0"
},
"require-dev": {
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.10",
"laravel/dusk": "^8.6",
"lucascudo/laravel-pt-br-localization": "^1.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^11.0",
"spatie/laravel-ignition": "^2.0",
"uspdev/laravel-usp-faker": "^1.0"
},
"repositories": [
Expand Down
142 changes: 141 additions & 1 deletion composer.lock

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

44 changes: 44 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
services:
chamados:
build: .
container_name: chamados
ports:
- "8000:80"
depends_on:
- mariadb
networks:
- chamados-network
volumes:
- ./:/var/www/html
environment:
HOME: /tmp
user: "${UID:-1000}:${GID:-1000}"

mariadb:
image: mariadb:11
container_name: chamados_mariadb
restart: always
environment:
MYSQL_DATABASE: chamados
MYSQL_USER: chamados
MYSQL_PASSWORD: chamados
MYSQL_ROOT_PASSWORD: chamados
volumes:
- mariadb_data:/var/lib/mysql
networks:
- chamados-network

selenium:
image: selenium/standalone-chrome
container_name: chamados_selenium
ports:
- "7900:7900" # VNC (pra ver o browser rodando)
networks:
- chamados-network
shm_size: 2gb

networks:
chamados-network:

volumes:
mariadb_data:
7 changes: 0 additions & 7 deletions dokku-deploy/apache-php.conf

This file was deleted.

8 changes: 0 additions & 8 deletions dokku-deploy/release.sh

This file was deleted.

21 changes: 21 additions & 0 deletions tests/Browser/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\Browser;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

class ExampleTest extends DuskTestCase
{
/**
* A basic browser test example.
*/
public function test_basic_example(): void
{
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertSee('Laravel');
});
}
}
21 changes: 21 additions & 0 deletions tests/Browser/IndexTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\Browser;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

class IndexTest extends DuskTestCase
{
/**
* A Dusk test example.
*/
public function test_example(): void
{
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertSee('Chamados');
});
}
}
Loading