Skip to content

Commit

Permalink
update cutom image
Browse files Browse the repository at this point in the history
  • Loading branch information
gOOvER committed Apr 6, 2024
1 parent 6adf88b commit 82941f4
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 8 deletions.
60 changes: 55 additions & 5 deletions custom/node16132/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,64 @@
FROM --platform=$TARGETOS/$TARGETARCH node:16.13.2-bullseye-slim

LABEL author="Michael Parker" maintainer="[email protected]"
LABEL author="Torsten Widmann" maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images"
LABEL org.opencontainers.image.licenses=MIT

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
&& apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip libnss3 autoconf automake g++ libtool build-essential pkg-config \
&& useradd -d /home/container -m container
&& apt -y upgrade

RUN apt -y install --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates\
curl \
dnsutils \
ffmpeg \
g++ \
git \
gnupg \
gnupg2 \
iproute2 \
iputils-ping \
libtool \
locales \
python3 \
python3-dev \
sqlite3 \
tzdata \
tini \
zip \
libnss3 \
libsqlite3-dev

RUN npm install typescript ts-node @types/node --location=global

# add Yarn
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt update \
&& apt -y install yarn

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ./../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
30 changes: 27 additions & 3 deletions custom/node16132/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
#!/bin/bash
cd /home/container
#System variables
clear
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'

# Switch to the container's working directory
cd /home/container || exit 1

# Wait for the container to fully initialize
sleep 1

# Default the TZ environment variable to UTC.
TZ=${TZ:-UTC}
export TZ

# Set environment variable that holds the Internal Docker IP
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
export INTERNAL_IP

# Print Node.js Version
node -v
# system informations
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${RED}NodeJS Image by gOOvER${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Running on Debian: ${RED} $(cat /etc/debian_version)${NC}"
echo -e "${YELLOW}Current timezone: ${RED} $(cat /etc/timezone)${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}NodeJS Version: ${RED} $(node -v) ${NC}"
echo -e "${YELLOW}npm Version: ${RED} $(npm -v) ${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"

# Replace Startup Variables
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
Expand Down

0 comments on commit 82941f4

Please sign in to comment.