Remove unnecessary stuff from the Docker build and compose

This commit is contained in:
powermaker450 2024-07-26 17:17:03 -04:00
parent 2f6b87b401
commit b47271c212
4 changed files with 12 additions and 27 deletions

6
.dockerignore Normal file
View file

@ -0,0 +1,6 @@
.env
.env.example
*.md
dist
prepare
node_modules

View file

@ -1,10 +1,9 @@
FROM node:20.12.2-alpine
RUN apk update > /dev/null && apk add git > /dev/null
RUN git clone https://git.povario.com/powermaker450/Tailchat-Assistant app > /dev/null
RUN mkdir /app
WORKDIR /app
COPY . .
RUN npm i && npm run build
ENV HOST="http://localhost:11000"
@ -19,7 +18,4 @@ ENV TEMPERATURE=1
ENV ALLOWED_CHAT=""
ENV SAFE_WORD="\\"
COPY ./entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["sh", "-c", "./entrypoint.sh"]
CMD ["npm", "run", "start"]

View file

@ -4,7 +4,6 @@ services:
image: tailchat_assistant
build:
context: .
env_file: ".env"
environment:
- HOST=${HOST}
- ID=${ID}
@ -17,7 +16,7 @@ services:
- ALLOWED_CHAT=${ALLOWED_CHAT}
- SAFE_WORD=${SAFE_WORD}
volumes:
- tailchat-assistant-data:/app/persist
- messages:/app/persist
volumes:
- tailchat-assistant-data:
messages:

View file

@ -1,16 +0,0 @@
cd /app
echo "" > .env && \
echo "HOST=$HOST" >> .env && \
echo "ID=$ID" >> .env && \
echo "SECRET=$SECRET" >> .env && \
echo "API_ENDPOINT=$API_ENDPOINT" >> .env && \
echo "API_KEY=$API_KEY" >> .env && \
echo "TEXT_MODEL=$TEXT_MODEL" >> .env && \
echo "CREATE_IMAGE_MODEL=$CREATE_IMAGE_MODEL" >> .env && \
echo "ANALYZE_IMAGE_MODEL=$ANALYZE_IMAGE_MODEL" >> .env && \
echo "TEMPERATURE=$TEMPERATURE" >> .env && \
echo "ALLOWED_CHAT=$ALLOWED_CHAT" >> .env && \
echo "SAFE_WORD=$SAFE_WORD" >> .env
npm run start