Adding custom TZ support.
This commit is contained in:
parent
63ee39a599
commit
c41b3ed134
4 changed files with 16 additions and 1 deletions
|
|
@ -8,6 +8,8 @@ ENV CONFIG_TEMPLATES_DIR=${INSTALL_DIR}/config-templates
|
|||
# Default UID/GID that can be overridden at runtime
|
||||
ENV UID=1000
|
||||
ENV GID=1000
|
||||
# Default timezone is UTC
|
||||
ENV TZ=Etc/UTC
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && \
|
||||
|
|
|
|||
3
Makefile
3
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
# Configuration
|
||||
IMAGE_NAME := greenmatthew/scp-secret-laboratory-server
|
||||
VERSION := 1.0.0
|
||||
VERSION := 1.0.1
|
||||
CONTAINER_NAME := scp-sl-server
|
||||
PORT := 7777
|
||||
SHELL := /bin/sh
|
||||
|
|
@ -24,6 +24,7 @@ run: build
|
|||
docker run -d --name $(CONTAINER_NAME) \
|
||||
-p $(PORT):$(PORT)/udp \
|
||||
-v $(PWD)/config:/home/steam/.config \
|
||||
-e TZ=America/Chicago \
|
||||
-e UID=1001 \
|
||||
-e GID=1001 \
|
||||
--restart unless-stopped \
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ services:
|
|||
environment:
|
||||
- UID=1000
|
||||
- GID=1000
|
||||
# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
|
||||
# - TZ=Etc/UTC
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
|
|
@ -55,6 +57,8 @@ docker run -d \
|
|||
-v ./config:/home/steam/.config \
|
||||
-e UID=1000 \
|
||||
-e GID=1000 \
|
||||
# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
|
||||
# -e TZ=Etc/UTC \
|
||||
--restart unless-stopped \
|
||||
greenmatthew/scp-secret-laboratory-server:latest
|
||||
```
|
||||
|
|
@ -74,6 +78,7 @@ Mounting the .config directory allows you to configure any server setting and ha
|
|||
|
||||
- `UID`: User ID to run the server as (default: 1000)
|
||||
- `GID`: Group ID to run the server as (default: 1000)
|
||||
- `TZ`: [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) for the container (default: Etc/UTC). Examples: `America/Chicago`, `Europe/London`, `Asia/Tokyo`
|
||||
|
||||
## Port Configuration
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Set timezone
|
||||
if [ ! -z "$TZ" ]; then
|
||||
echo "Setting timezone to $TZ"
|
||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
|
||||
echo $TZ > /etc/timezone
|
||||
fi
|
||||
|
||||
echo "Setting up container with UID:${UID} and GID:${GID}"
|
||||
|
||||
# Check if group with GID exists
|
||||
|
|
|
|||
Loading…
Reference in a new issue