Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Added docker logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul Del Pozo Moreno committed Jul 14, 2022
1 parent 45020fd commit e4b258b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ models/*.tar.gz
*.html
results
.keras
.config
.config
logs
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM rasa/rasa:3.1.1
WORKDIR '/app'
COPY . /app


USER root
# WORKDIR /app
# COPY . /app
COPY ./data /app/data
RUN rasa train
VOLUME /app
VOLUME /app/data
VOLUME /app/models
CMD ["run","-m","/app/models","--enable-api","--cors","*","--debug" ,"--endpoints", "endpoints.yml", "--log-file", "out.log", "--debug"]
COPY . /app
WORKDIR '/app'

# Neccesary to run the server inside the docker container
RUN sed -i "s/localhost:5055/action_server:5055/g" endpoints.yml

RUN rasa train
CMD ["run", "-m", "/app/models", "--enable-api", "--cors", "*", "--debug", "--endpoints", "endpoints.yml", "--log-file", "logs/rasa.log", "--debug"]
13 changes: 8 additions & 5 deletions actions/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM rasa/rasa-sdk:3.1.1
WORKDIR /app
COPY requirements.txt requirements.txt

USER root
WORKDIR /app

RUN pip install --upgrade pip
RUN pip install --verbose -r requirements.txt
RUN apt-get update
RUN apt-get install -y locales

RUN apt-get update && apt-get install -y locales
RUN locale-gen es_ES
RUN locale-gen es_ES.utf8

COPY requirements.txt requirements.txt
RUN pip install --upgrade pip
RUN pip install --verbose -r requirements.txt

EXPOSE 5055
USER 1001
3 changes: 1 addition & 2 deletions actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

data_path = "/app/actions"
if not path.exists(data_path):
data_path = "."

data_path = "./actions"
names = pathlib.Path(
data_path+"/data/diccionarios/nombres.txt").read_text().split("\n")
malsonantes = pathlib.Path(
Expand Down
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ services:
ports:
- 5005:5005
volumes:
- ./:/app
command:
- run
- "./logs:/app/logs"
depends_on:
- action_server
action_server:
container_name: rasa-actions
build:
context: actions
volumes:
- ./actions:/app/actions
ports:
- 5055:5055
volumes:
- "./actions:/app/actions"

volumes:
logs:
actions:
2 changes: 1 addition & 1 deletion endpoints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# https://rasa.com/docs/rasa/custom-actions

action_endpoint:
url: "http://action_server:5055/webhook"
url: "http://localhost:5055/webhook"

# Tracker store which is used to store the conversations.
# By default the conversations are stored in memory.
Expand Down

0 comments on commit e4b258b

Please sign in to comment.