-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
60 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
.git | ||
.github | ||
.vscode | ||
save_data_re | ||
tests | ||
venv/ | ||
logs/ | ||
gamesave*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,26 @@ | ||
# Use an official Python runtime as a parent image | ||
# FROM python:3.11-slim | ||
FROM nikolaik/python-nodejs:python3.12-nodejs21-slim | ||
|
||
# Define environment variables for customization | ||
# ENV TZ=UTC \ | ||
# PUID=1000 \ | ||
# PGID=1000 \ | ||
# APP_PORT=8000 \ | ||
# APP_LANG=en \ | ||
# LANG=C.UTF-8 \ | ||
# PYTHONUNBUFFERED=1 \ | ||
# MODE=--cli \ | ||
# SAVE_PATH="/mnt/gamesave" \ | ||
# PASSWORD=null | ||
|
||
# Set the working directory in the container | ||
ENV PATH=/usr/local/nginx/bin:$PATH | ||
EXPOSE $APP_PORT | ||
|
||
WORKDIR /app | ||
|
||
# Install dependencies required for managing permissions and timezone | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
tini \ | ||
gosu \ | ||
tzdata \ | ||
# && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | ||
# && apt-get install -y nodejs \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# https://github.com/nikolaik/docker-python-nodejs | ||
# All images have a default user `pn`` with uid 1000 and gid 1000. | ||
# Create the appuser user and group before setting permissions | ||
# RUN groupadd -g 1000 appuser && \ | ||
# useradd -m -u 1000 -g appuser -s /bin/bash appuser | ||
|
||
# Copy the application's requirements.txt and setup script, then install Python dependencies | ||
# COPY ./requirements.txt ./ | ||
# RUN pip install --no-cache-dir -r requirements.txt | ||
COPY --chown=pn:pn ./ /app | ||
|
||
# Copy the rest of the application's source code | ||
COPY ./ /app | ||
RUN cd "/app/frontend/palworld-pal-editor-webui" \ | ||
&& npm install \ | ||
&& npm run build \ | ||
&& mv "/app/frontend/palworld-pal-editor-webui/dist" "/app/src/palworld_pal_editor/webui" | ||
|
||
# Copy the entrypoint script into the image and make it executable | ||
COPY ./docker/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
RUN chmod +x /app/setup_and_run.sh | ||
RUN pip install --no-cache-dir -r requirements.txt \ | ||
&& pip install -e . | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
# Expose the port dynamically | ||
EXPOSE $APP_PORT | ||
RUN chmod +x /app/docker/app.sh | ||
|
||
CMD ["./setup_and_run.sh"] | ||
CMD ["/app/docker/app.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -z "$PUID" ] && [ ! -z "$PGID" ]; then | ||
usermod -u $PUID pn | ||
groupmod -g $PGID pn | ||
fi | ||
|
||
cmd="python -m palworld_pal_editor --nocli" | ||
|
||
if [ -n "$APP_LANG" ]; then cmd="$cmd --lang=\"$APP_LANG\""; fi | ||
if [ -n "$APP_PORT" ]; then cmd="$cmd --port=$APP_PORT"; fi | ||
if [ -n "$MODE" ]; then cmd="$cmd --mode=\"$MODE\""; fi | ||
if [ -n "$SAVE_PATH" ]; then cmd="$cmd --path=\"$SAVE_PATH\""; fi | ||
if [ -n "$PASSWORD" ]; then cmd="$cmd --password=\"$PASSWORD\""; fi | ||
|
||
echo "Launching: $cmd" | ||
|
||
eval "$cmd" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
version: '3.8' | ||
services: | ||
palworld-pal-editor: | ||
image: docker.io/library/palworld-pal-editor | ||
image: ghcr.io/kriscris/palworld-pal-editor:latest | ||
restart: unless-stopped | ||
container_name: palworld-pal-editor | ||
# network_mode: host | ||
ports: | ||
- 12345:12345 | ||
- 58888:58888 | ||
environment: | ||
- TZ=UTC | ||
- PUID=1000 | ||
- PUID=1000 # change this to your uid | ||
- PGID=1000 | ||
- APP_PORT=12345 # make sure this matches the port you are going to map | ||
- APP_LANG=zh-CN | ||
- MODE=web # [cli, web, gui] You are not going to run gui in docker though... ;) | ||
- SAVE_PATH=/mnt/gamesave | ||
- PASSWORD=password # remove this env unless you want a password, but password is strongly recommended (for web mode). | ||
- APP_PORT=58888 # make sure this matches the port you are going to map | ||
- APP_LANG=en # options: en, zh-CN, ja | ||
- MODE=web | ||
- SAVE_PATH=/mnt/gamesave # this should match the volume you mapped to | ||
- PASSWORD=password # to prevent unauthorized access, setting up a strong password is recommended. | ||
volumes: | ||
- "/Users/connlost/Coding/Palworld-Pal-Editor/tests/gamesave/AF518B19A47340B8A55BC58137981393:/mnt/gamesave" | ||
- "/Host/Path/To/The/GameSave/AF518B19A47340B8A55BC58137981393:/mnt/gamesave" # host path : container path |