-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker: No longer building the app in runtime.
- Loading branch information
Showing
5 changed files
with
34 additions
and
71 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
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