Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Modified Rasa UI server to support env variables (can be set from docker)
- Loading branch information
Showing
5 changed files
with
94 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,60 @@ | ||
FROM node:boron | ||
FROM ubuntu:16.04 | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
RUN apt-get update | ||
## Install base environment | ||
RUN apt-get install -y wget python python-pip | ||
|
||
# Install app dependencies | ||
COPY package.json package-lock.json ./ | ||
## Nodejs | ||
# Prepare | ||
WORKDIR /opt/ | ||
# Download | ||
RUN wget https://nodejs.org/dist/v6.11.1/node-v6.11.1-linux-x64.tar.xz | ||
# Unpack | ||
RUN tar xf node-v6.11.1-linux-x64.tar.xz | ||
RUN rm node-v6.11.1-linux-x64.tar.xz | ||
RUN mv node-v6.11.1-linux-x64 node | ||
# Install | ||
WORKDIR /opt/node | ||
RUN mv bin/* /usr/bin/ | ||
RUN mv include/* /usr/include/ | ||
RUN mv lib/* /usr/lib/ | ||
RUN mv share/doc/* /usr/share/doc/ | ||
RUN mv share/man/man1/* /usr/share/man/man1/ | ||
RUN mv share/systemtap/* /usr/share/systemtap/ | ||
|
||
## Postgres | ||
# Installation | ||
RUN apt-get install -y postgresql postgresql-contrib | ||
|
||
# Configuration | ||
RUN mkdir /opt/pgsql | ||
RUN chown postgres -R /opt/pgsql | ||
WORKDIR /opt/postgresql | ||
|
||
ADD resources/dbcreate.sql dbcreate.sql | ||
RUN service postgresql start && su postgres -c "createuser rasaui && echo \"create database rasaui; \c rasaui; \i dbcreate.sql\" | psql && echo \"grant all on database rasaui to rasaui; grant all privileges on all tables in schema public to rasaui; grant all privileges on all sequences in schema public to rasaui \"|psql rasaui" && service postgresql stop | ||
|
||
## RasaUI | ||
# Installation | ||
ADD . /opt/rasaui | ||
WORKDIR /opt/rasaui | ||
|
||
# Install server packages | ||
RUN npm install | ||
|
||
# Bundle app source | ||
COPY . . | ||
# Setup user | ||
RUN useradd rasaui | ||
RUN chown rasaui -R . | ||
|
||
#Install webapp dependencies | ||
WORKDIR /usr/src/app/web/src/ | ||
RUN cd /usr/src/app/web/src/ | ||
# Install web packages | ||
WORKDIR /opt/rasaui/web/src | ||
RUN npm install | ||
WORKDIR /opt/rasaui | ||
|
||
# Setup RasaUI configuration | ||
RUN sed -r 's/("postgresConnectionString": )"[^"]*"(.*)/\1"\/var\/run\/postgresql"\2/' -i package.json | ||
ENV rasaserver=http://localhost:5000 | ||
|
||
WORKDIR /usr/src/app | ||
RUN ls -ltr | ||
EXPOSE 5001 | ||
CMD [ "npm", "start" ] | ||
|
||
ENTRYPOINT bash -c 'hostname -I; service postgresql start && su rasaui -c "npm start"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters