Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (51 loc) · 1.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
53 lines (51 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
services:
docker-laravel:
build:
context: .
dockerfile: Dockerfile
image: tweakphp-e2e-php83:latest
container_name: tweakphp-docker-app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./apps/docker-app:/var/www/html
ports:
- "8080:8000"
command: >
bash -c "if [ -f artisan ]; then php artisan serve --host=0.0.0.0 --port=8000; else tail -f /dev/null; fi"
sail-laravel:
build:
context: .
dockerfile: Dockerfile
image: tweakphp-e2e-php83:latest
container_name: tweakphp-sail-app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./apps/sail-app:/var/www/html
ports:
- "8081:8000"
command: >
bash -c "if [ -f artisan ]; then php artisan serve --host=0.0.0.0 --port=8000; else tail -f /dev/null; fi"
ssh-laravel:
build:
context: .
dockerfile: Dockerfile
image: tweakphp-e2e-php83:latest
container_name: tweakphp-ssh-app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./apps/ssh-app:/var/www/html
ports:
- "2222:22"
command: >
bash -c "mkdir -p /var/run/sshd &&
ssh-keygen -A &&
id -u tweakphp >/dev/null 2>&1 || useradd -m -s /bin/bash tweakphp &&
echo 'tweakphp:secret123' | chpasswd &&
echo 'root:secret123' | chpasswd &&
sed -i 's/#*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config &&
sed -i 's/#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
chown -R tweakphp:tweakphp /var/www/html &&
/usr/sbin/sshd -D"