Skip to content

Commit

Permalink
Merge pull request #6 from Sammyjo20/feature/storage-directory-volume
Browse files Browse the repository at this point in the history
Various Improvements
  • Loading branch information
Sammyjo20 authored Jul 30, 2024
2 parents b9a26e1 + 7b9c5b8 commit 8695dce
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ This will run the SSH server in your terminal window. In another window, you sho
ssh localhost -p 2201
```

### Installing additional PHP extensions
You may need to add additional extensions to get your server to work in production. You can do
this by modifying the `Dockerfile` in the root directory. The base image runs Alpine Linux and
has a few common PHP extensions, however you can add more here if you need.

```
RUN apk add php-redis
```

## Deploying to production

### Requirements
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ FROM sammyjo20/ssh-php:latest

USER root

# You can add any additional PHP extensions by using `RUN apk add [extensions]`.

# RUN apk add php-redis

# --------------------------------------

# Copy all files

COPY ./src ./src
Expand All @@ -27,4 +33,4 @@ USER server

# Run Composer install without dependencies

RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-reqs
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
services:
server:
# platform: linux/amd64 # Change to linux/arm/v7 for Raspberry Pi (or v8 etc)
build:
context: .
volumes:
- ssh-php-ssh:/home/server/.ssh
ports:
- 2201:22 # Change to 22:22 if you don't have an SSH server running already
restart: unless-stopped
restart: always
logging:
driver: "json-file"
options:
Expand Down
5 changes: 4 additions & 1 deletion src/app/Renderers/HomeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ public function __invoke(App $app): static
'',
'Welcome to SSH-PHP, ' . $name . '!',
'',
'🔗 https://github.com/sammyjo20/ssh-php',
'',
'',
'❤️',
'',
'Support the project https://github.com/sponsors/Sammyjo20',
'Support the project https://github.com/sponsors/sammyjo20',
];

$this->center($lines, $width, $height)
Expand Down

0 comments on commit 8695dce

Please sign in to comment.