Skip to content

Commit 5080934

Browse files
committed
Merge branch 'staging' into deployment
2 parents bb06462 + cebd14b commit 5080934

File tree

9 files changed

+57
-235
lines changed

9 files changed

+57
-235
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// https://aka.ms/devcontainer.json
22
{
3-
"name": "Existing Docker Compose (Extend)",
3+
"name": "Mars development",
44
"dockerComposeFile": [
55
"../docker-compose.yml"
66
],
7-
"service": "laravel.test",
8-
"workspaceFolder": "/var/www/html",
7+
"service": "mars_dev",
8+
"workspaceFolder": "/workspace/mars",
99
"settings": {},
1010
"extensions": [
1111
// "mikestead.dotenv",
@@ -14,9 +14,9 @@
1414
// "onecentlin.laravel5-snippets",
1515
// "onecentlin.laravel-blade"
1616
],
17-
"remoteUser": "sail",
18-
"postCreateCommand": "chown -R 1000:1000 /var/www/html"
17+
"remoteUser": "ubuntu",
18+
"postCreateCommand": "make build"
1919
// "forwardPorts": [],
2020
// "runServices": [],
2121
// "shutdownAction": "none",
22-
}
22+
}

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
build:
2+
npm install
3+
composer install
4+
npm run dev
5+
cp .env.example .env
6+
php artisan key:generate
7+
php artisan migrate
8+
9+
seed:
10+
php artisan db:seed
11+
12+
serve:
13+
php artisan serve --host=0.0.0.0

app/Http/Controllers/Dormitory/Printing/PrintJobController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ public function store(Request $request)
121121
Log::error("Error while creating print job: " . $e->getMessage());
122122
return back()->with('error', __('print.error_printing'));
123123
} finally {
124-
Storage::disk('printing')->delete($path);
124+
/*
125+
* Let's keep around the documents for easier troubleshooting
126+
* TODO: clean up after an interval (e.g. 7 days)
127+
*/
128+
// Storage::disk('printing')->delete($path);
125129
}
126130

127131
DB::commit();

app/Models/Printer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public function print(bool $twoSided, int $copies, string $path)
8787
'lp',
8888
'-h', "$this->ip:$this->port",
8989
'-d', $this->name,
90-
($twoSided ? '-o sides=two-sided-long-edge' : ''),
91-
'-n', $copies,
92-
$path
90+
'-o', ($twoSided ? 'sides=two-sided-long-edge' : 'sides=one-sided'),
91+
'-n', $copies,
92+
$path
9393
]);
9494
$process->run();
9595
if (!$process->isSuccessful()) {

docker-compose.gitpod.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

docker-compose.yml

Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,32 @@
1-
# For more information: https://laravel.com/docs/sail
21
version: '3'
2+
33
services:
4-
laravel.test:
5-
build:
6-
context: ./vendor/laravel/sail/runtimes/8.2
7-
dockerfile: Dockerfile
8-
args:
9-
WWWGROUP: '${WWWGROUP}'
10-
image: sail-8.2/app
11-
extra_hosts:
12-
- 'host.docker.internal:host-gateway'
13-
ports:
14-
- '${APP_PORT:-80}:80'
15-
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
16-
environment:
17-
WWWUSER: '${WWWUSER}'
18-
LARAVEL_SAIL: 1
19-
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
20-
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
21-
volumes:
22-
- '.:/var/www/html'
23-
networks:
24-
- sail
25-
depends_on:
26-
- mysql
27-
mysql:
28-
image: 'mysql/mysql-server:8.0'
29-
ports:
30-
- '${FORWARD_DB_PORT:-3306}:3306'
31-
environment:
32-
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
33-
MYSQL_ROOT_HOST: '%'
34-
MYSQL_DATABASE: '${DB_DATABASE}'
35-
MYSQL_USER: '${DB_USERNAME}'
36-
MYSQL_PASSWORD: '${DB_PASSWORD}'
37-
MYSQL_ALLOW_EMPTY_PASSWORD: 1
38-
volumes:
39-
- 'sail-mysql:/var/lib/mysql'
40-
- './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
41-
networks:
42-
- sail
43-
healthcheck:
44-
test:
45-
- CMD
46-
- mysqladmin
47-
- ping
48-
- '-p${DB_PASSWORD}'
49-
retries: 3
50-
timeout: 5s
51-
networks:
52-
sail:
53-
driver: bridge
4+
mysql:
5+
container_name: mysql
6+
image: mysql:8.3
7+
environment:
8+
MYSQL_DATABASE: 'mars'
9+
MYSQL_USER: 'mars'
10+
MYSQL_PASSWORD: 'secret'
11+
MYSQL_ROOT_PASSWORD: 'secret'
12+
ports:
13+
- '127.0.0.1:3307:3306'
14+
expose:
15+
- '3306'
16+
volumes:
17+
- mars_db:/var/lib/mysql
18+
mars_dev:
19+
container_name: mars_dev
20+
image: mars_image:latest
21+
pull_policy: never
22+
build:
23+
context: ./docker-dev-setup
24+
depends_on:
25+
- mysql
26+
volumes:
27+
- ".:/workspace/mars"
28+
ports:
29+
- '127.0.0.1:8000:8000'
30+
5431
volumes:
55-
sail-mysql:
56-
driver: local
32+
mars_db:

docker-dev-setup/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN apt-get update \
99
libzip-dev libpng-dev libonig-dev libcurl4-openssl-dev libxml2-dev \
1010
php8.3-cli php8.3-mysql php8.3-zip php8.3-gd php8.3-mbstring php8.3-curl php8.3-xml php8.3-bcmath \
1111
texlive-latex-base texlive-latex-extra texlive-lang-european \
12+
make \
1213
&& apt-get clean && rm -rf /var/lib/apt/lists/*
1314

1415
# Install Node.js

docker-dev-setup/README.md

Lines changed: 0 additions & 120 deletions
This file was deleted.

docker-dev-setup/docker-compose.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)