added Dockerfile & added --port --domain --skip-config-check flags

This commit is contained in:
partisan 2024-11-21 12:30:16 +01:00
parent 3ca7d57680
commit 28f71271d7
5 changed files with 249 additions and 18 deletions

32
Dockerfile Normal file
View file

@ -0,0 +1,32 @@
# Use Alpine Linux as the base image
FROM alpine:3.20
# Update and install Golang and Git
RUN apk update && apk add --no-cache go git
# Create a new user and switch to it
RUN adduser -D myuser
USER myuser
# Set the working directory
WORKDIR /home/myuser
# Clone the Git repository
RUN git clone https://weforge.xyz/Spitfire/Search.git
# Change directory to the cloned repository
WORKDIR /home/myuser/Search
# Ensure the run.sh script is executable
RUN chmod +x run.sh
# Expose the application's port
EXPOSE 5000
# Define environment variables for port and domain with default values
ENV PORT=
ENV DOMAIN=
ENV SKIP_CONFIG="--skip-config-check"
# Run the run.sh script on container start
CMD ["sh", "-c", "./run.sh $SKIP_CONFIG --port ${PORT:-} --domain ${DOMAIN:-}"]