Skip to content

Commit

Permalink
Merge pull request #90 from MitchTalmadge/staging
Browse files Browse the repository at this point in the history
SDL and Custom Scripts
  • Loading branch information
MitchTalmadge authored Sep 22, 2021
2 parents 62e24fd + 7a6e91b commit a6ff5c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ RUN dpkg --add-architecture i386 && \
libcurl3-gnutls:i386 \
libcurl4 \
libncurses5:i386 \
libsdl2-2.0-0 \
libsdl2-2.0-0:i386 \
libtinfo5:i386 \
# --------------------
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,27 @@ Example: `TZ=America/Denver`
|-------|----------------------------------------------------------------------|---------------|
| `NIGHTLY` | Set to any value to enable nightly builds. All instances will be migrated to nightly builds on next image start. Unset this variable to go back to MainLine builds (stable releases). | UNSET |


## Volumes

| Mount Point | Description |
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `/home/amp/.ampdata` | **Required!** This volume contains everything AMP needs to run. This includes all your instances, all their game files, the web ui sign-in info, etc. Essentially, without creating this volume, AMP will be wiped on every boot.|
| Mount Point | Description |
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `/home/amp/.ampdata` | **Required!** This volume contains everything AMP needs to run. This includes all your instances, all their game files, the web ui sign-in info, etc. Essentially, without creating this volume, AMP will be wiped on every boot. |
| `/home/amp/scripts` | This volume allows you to provide custom scripts that will run at certain points during this container's lifecycle. See the section below about custom scripts. |

### Custom Scripts

If you would like to run your own shell scripts in this container, which can be useful to e.g. install extra dependencies for a game's plugin, you can use the `/home/amp/scripts` volume.

Currently, only one script is supported: `startup.sh`. Place a file named `startup.sh` into the volume, and it will be run on container startup.

**Example: Installing extra packages**
```sh
echo "Downloading dependencies for Valheim Plus Mod..."
apt-get update && \
apt-get install -y \
libc6 \
libc6-dev
```

## HTTPS / SSL / TLS

Expand Down
8 changes: 8 additions & 0 deletions entrypoint/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ echo "Thank you!!"
echo "----------------------"
echo ""

# Run user startup script
STARTUP_SCRIPT="/home/amp/scripts/startup.sh"
if [ -f ${STARTUP_SCRIPT} ]; then
echo "Running startup script..."
chmod +x ${STARTUP_SCRIPT}
/bin/bash ${STARTUP_SCRIPT}
fi

# Copy the pre-cached AMP Core from the image into the location AMP expects.
# This will allow upgrades to use the cache and not need to do any downloads.
echo "Copying AMP Core..."
Expand Down

0 comments on commit a6ff5c0

Please sign in to comment.