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

docker quickstart #19

Merged
merged 3 commits into from
Aug 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,24 @@ jobs:
- run: *notify0
- run: *notify1

# TODO make it work
docker_install:
working_directory: ~/project/docker
machine: true
steps:
- checkout: *checkout
- run: echo "Ignored for now, networking is slightly complex"
# - run: |
# echo 127.0.0.1 front.localhost | sudo tee -a /etc/hosts
# echo 127.0.0.1 backend.localhost | sudo tee -a /etc/hosts
# - run: ./install.sh --non-interactive --rev $CIRCLE_SHA1
# - run: ./test.sh

workflows:
version: 2
test_and_deploy:
jobs:
- docker_install
- backend_test:
filters:
branches:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.vscode
config
values.dev.yaml
.env
*.env.local
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
jobs:
include:
# Stage that tests the docker-compose part.
- stage: test
before_script:
- cd docker
- docker-compose up &
script:
- ./test.sh
# Stage that tests the install script itself.
- sudo: required
before_script:
- cd docker
- ./install.sh --non-interactive --rev $TRAVIS_COMMIT &
script:
- ./test.sh
# Stage that tests the install script on macos.

addons:
hosts:
- front.localhost
- back.localhost
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Opensource chatbot builder
## Run Opla

### Run locally with docker-compose
Coming soon.

The quickest way to run opla locally is to follow [this guide](docker/README.md)

## Development

Expand Down
10 changes: 10 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
OPLA_FRONT_DOMAIN=localhost
OPLA_FRONT_CLIENT_NAME=opla

OPLA_API_DOMAIN=localhost
OPLA_BACKEND_HOST=backend
OPLA_BACKEND_DATABASE_HOST=db
OPLA_BACKEND_DATABASE_NAME=opla
OPLA_BACKEND_DATABASE_USER=opla
OPLA_BACKEND_DATABASE_PASS=foo
OPLA_BACKEND_PORT=80
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opla-ce/
8 changes: 8 additions & 0 deletions docker/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
docker installation on linux:
image: ubuntu:16.04
script:
- |
apt-get update && apt-get install -y unzip curl
./install.sh --non-interactive --no-run --rev $CI_COMMIT_SHA
docker --version
docker-compose --version
339 changes: 339 additions & 0 deletions docker/LICENSE

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Opla - docker quick start guide

[![Build Status](https://travis-ci.org/Opla/opla.svg?branch=master)](https://travis-ci.org/Opla/opla)

In 5 minutes you create your own conversational assistant using this opensource tool.

# Getting started

## Quick start for Unix users (Linux, Mac)

### TL;DR
```
curl -fsSL https://github.com/opla/opla/raw/master/docker/install.sh -o install.sh
chmod +x install.sh
./install.sh
```

You should then be able to navigate to http://localhost/ and create your chatbot.

### From a specific revision/branch/tag :
```
export REV=<branch|tag|commit_sha>
curl -fsSL https://github.com/opla/opla/raw/$REV/docker/install.sh -o install.sh
chmod +x install.sh
./install.sh --rev $REV
```

## For Windows (non-unix) users / alternative to install.sh

### Prerequisites
- `docker` and `docker-compose`

### Build and run

```
docker-compose up
```

You should then be able to navigate to http://front.localhost/ and create your chatbot.
68 changes: 68 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: "3"
services:

db:
image: mariadb:10.2
restart: always
environment:
MYSQL_DATABASE: ${OPLA_BACKEND_DATABASE_NAME}
MYSQL_USER: ${OPLA_BACKEND_DATABASE_USER}
MYSQL_PASSWORD: ${OPLA_BACKEND_DATABASE_PASS}
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
networks:
- private

backend:
image: "opla/backend:latest"
restart: always
networks:
private:
aliases: ["${OPLA_API_DOMAIN}"]
expose:
- "80"
depends_on:
- db
environment:
- PORT=80
- OPLA_BACKEND_DATABASE_HOST
- OPLA_BACKEND_DATABASE_NAME
- OPLA_BACKEND_DATABASE_USER
- OPLA_BACKEND_DATABASE_PASS

front:
image: "opla/front:latest"
restart: always
networks:
- private
depends_on:
- backend
expose:
- "80"
environment:
- PORT=80
- OPLA_API_DOMAIN
- OPLA_BACKEND_HOST
- OPLA_FRONT_CLIENT_NAME
- OPLA_BACKEND_PORT
- APP_INSTANCE_NAME=LOCAL
- APP_INSTANCE_COLOR=#42f44e
volumes:
- "/srv/app/config"

nginx:
build: nginx
restart: always
depends_on:
- front
ports:
- "80:80"
networks:
- private
- public
environment:
- OPLA_FRONT_DOMAIN
- OPLA_API_DOMAIN

networks:
public:
private:
Loading