Compare commits

..

No commits in common. "8f91eba0f76c5eb203a4836a1a44ebb041d63192" and "b3be2ee10f935dca13f54ca7e10cbb1b400e1848" have entirely different histories.

4 changed files with 3 additions and 34 deletions

@ -3,9 +3,6 @@ FROM node:lts-slim
ENV NODE_ENV=production
WORKDIR /usr/src/app
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install wget -y
# Copy package.json and package-lock.json separately to fully utilize Docker layer caching
COPY package.json ./
COPY package-lock.json ./
@ -27,4 +24,4 @@ ENV NODE_ENV=production
EXPOSE 3000
# Start the app
CMD ["bash", "start.sh"]
CMD ["npm", "start"]

@ -14,4 +14,4 @@ services:
- 3000:3000
volumes:
- ./config.json:/usr/src/app/config.json:ro # The application config (Must be created before starting the service)
- ./public:/usr/src/app/public:rw # Used for public facing images (eg: avatar and background)
#- ./public:/usr/src/app/public:ro # Used for public facing images (uncomment if you are using your own images - see the public directory)

@ -1,6 +1,6 @@
{
"name": "simple-links",
"version": "0.1.7",
"version": "0.1.6",
"private": false,
"scripts": {
"dev": "next dev",

@ -1,28 +0,0 @@
workDir=/usr/src/app
baseUrl=https://git.fascinated.cc/Fascinated/simple-links/raw/branch/master/public/
toDownload=("avatar.webp" "background.jpg")
echo "Checking if files need to be downloaded"
if [ -z "$(ls -A $workDir/public)" ]; then
echo "Some files are missing, downloading them"
if [ ! -w "$workDir" ]; then
# TODO: fix this. it doesn't seem to be working?
echo "The directory \"$workDir\" is not writeable, unable to download files. Please check your docker compose for :ro and set it to :rw"
fi
for item in "${toDownload[@]}"
do
dir=$workDir/public/$item
if [ ! -e "$dir" ]; then
echo "Downloading $item to directory $dir"
wget -q -P $dir $baseUrl$item
echo "Done"
fi
done
echo "Finished downloading files!"
else
echo "All files are already present, no need to download"
fi
echo "Starting Simple Links..."
npm start