:construction_worker: Add docker-compose & fix #51
authormathieu.brunot <redacted>
Sat, 1 Jun 2019 14:49:32 +0000 (16:49 +0200)
committermathieu.brunot <redacted>
Sat, 1 Jun 2019 14:49:32 +0000 (16:49 +0200)
.travis.yml
php-apache/docker-compose.yml [new file with mode: 0644]
php-fpm/docker-compose.yml [new file with mode: 0644]

index 319a63eb941d95ec73f5c72f89d773c61a101c54..ba0580d41480d8c456fb4f7d72416eb0f53fd5a0 100644 (file)
@@ -11,18 +11,17 @@ branches:
 
 before_script:
   - env | sort
-  - name="roundcubemail"
-  - image="roundcube/roundcubemail:${VERSION}${VARIANT:+-$VARIANT}"
   - dir="php-${VARIANT}"
 
 script:
-  - travis_retry docker build -t "$image" "$dir"
-
-after_script:
+  - cd "$dir"
+  - docker-compose build
   - docker images
-  - docker run --name "$name" -d "$image" "$dir"
-  - docker ps
-  - docker logs "$name"
+  - travis_retry docker-compose up -d && sleep 60
+  - docker-compose ps
+  - docker-compose logs
+  - docker-compose ps "roundcubedb" | grep "Up"
+  - docker-compose ps "roundcube" | grep "Up"
 
 notifications:
   email: false
diff --git a/php-apache/docker-compose.yml b/php-apache/docker-compose.yml
new file mode 100644 (file)
index 0000000..276370d
--- /dev/null
@@ -0,0 +1,36 @@
+version: "2"
+
+services:
+  roundcube:
+    build: ./
+    container_name: roundcube
+    #restart: always
+    depends_on:
+      - roundcubedb
+    links:
+      - roundcubedb
+    ports:
+      - 80:80
+    volumes:
+      - /srv/roundcube/html:/var/www/html
+    environment:
+      - ROUNDCUBEMAIL_DB_TYPE=mysql
+      - ROUNDCUBEMAIL_DB_HOST=roundcubedb # same as mysql container name
+      - ROUNDCUBEMAIL_DB_NAME=roundcube # same as mysql MYSQL_DATABASE env name
+      - ROUNDCUBEMAIL_DB_USER=roundcube # same as mysql MYSQL_USER env name
+      - ROUNDCUBEMAIL_DB_PASSWORD=roundcubedbpass # same as mysql MYSQL_PASSWORD env name
+
+  roundcubedb:
+    image: mariadb:latest
+    container_name: roundcubedb
+    restart: always
+    command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE
+    ports:
+      - 3306:3306
+    volumes:
+      - /srv/roundcube/db:/var/lib/mysql
+    environment:
+      - MYSQL_ROOT_PASSWORD=mysqlrootpassword
+      - MYSQL_DATABASE=roundcube
+      - MYSQL_USER=roundcube
+      - MYSQL_PASSWORD=roundcubedbpass
diff --git a/php-fpm/docker-compose.yml b/php-fpm/docker-compose.yml
new file mode 100644 (file)
index 0000000..e9b084a
--- /dev/null
@@ -0,0 +1,57 @@
+version: "2"
+
+services:
+  roundcube:
+    build: ./
+    container_name: roundcube
+    #restart: always
+    depends_on:
+      - roundcubedb
+    links:
+      - roundcubedb
+    ports:
+      - 9000:9000
+    volumes:
+      - /srv/roundcube/html:/var/www/html
+    environment:
+      - ROUNDCUBEMAIL_DB_TYPE=pgsql
+      - ROUNDCUBEMAIL_DB_HOST=roundcubedb # same as pgsql container name
+      - ROUNDCUBEMAIL_DB_NAME=roundcube # same as pgsql POSTGRES_DB env name
+      - ROUNDCUBEMAIL_DB_USER=roundcube # same as pgsql POSTGRES_USER env name
+      - ROUNDCUBEMAIL_DB_PASSWORD=roundcube # same as pgsql POSTGRES_PASSWORD env name
+
+  roundcubedb:
+    image: postgres:latest
+    container_name: roundcubedb
+    restart: always
+    ports:
+      - 5432:5432
+    volumes:
+      - /srv/roundcube/db:/var/lib/postgresql/data
+    environment:
+      - POSTGRES_DB=roundcube
+      - POSTGRES_USER=roundcube
+      - POSTGRES_PASSWORD=roundcube
+
+  roundcubenginx:
+    image: nginx:latest
+    container_name: roundcubenginx
+    restart: always
+    ports:
+      - 80:80
+      # If you need SSL connection
+      # - '443:443'
+    depends_on:
+      - roundcube
+    links:
+      - roundcube
+    volumes:
+      - /srv/roundcube/html:/var/www/html
+      # TODO Provide a custom nginx conf
+      #- ./nginx.conf:/etc/nginx/nginx.conf:ro
+      # If you need SSL connection, you can provide your own certificates
+      # - ./certs:/etc/letsencrypt
+      # - ./certs-data:/data/letsencrypt
+    environment:
+      - NGINX_HOST=localhost # set your local domain or your live domain
+      # - NGINX_CGI=roundcube:9000 # same as roundcube container name
git clone https://git.99rst.org/PROJECT