move docker compose to wihtin this reo, update copy to server task
This commit is contained in:
parent
f783276759
commit
3a628fa57f
|
@ -0,0 +1,93 @@
|
||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
rocketchat:
|
||||||
|
image: registry.rocket.chat/rocketchat/rocket.chat:latest
|
||||||
|
command: >
|
||||||
|
bash -c
|
||||||
|
"for i in `seq 1 30`; do
|
||||||
|
node main.js &&
|
||||||
|
s=$$? && break || s=$$?;
|
||||||
|
echo \"Tried $$i times. Waiting 5 secs...\";
|
||||||
|
sleep 5;
|
||||||
|
done; (exit $$s)"
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./uploads:/app/uploads
|
||||||
|
environment:
|
||||||
|
- PORT=3000
|
||||||
|
- ROOT_URL=http://localhost:3000
|
||||||
|
- MONGO_URL=mongodb://mongo:27017/rocketchat
|
||||||
|
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
|
||||||
|
- REG_TOKEN=${REG_TOKEN}
|
||||||
|
# - MAIL_URL=smtp://smtp.email
|
||||||
|
# - HTTP_PROXY=http://proxy.domain.com
|
||||||
|
# - HTTPS_PROXY=http://proxy.domain.com
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
labels:
|
||||||
|
- "traefik.backend=rocketchat"
|
||||||
|
- "traefik.frontend.rule=Host: your.domain.tld"
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: mongo:4.0
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./data/db:/data/db
|
||||||
|
- ./data/dump:/dump
|
||||||
|
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=false"
|
||||||
|
|
||||||
|
# this container's job is just run the command to initialize the replica set.
|
||||||
|
# it will run the command and remove himself (it will not stay running)
|
||||||
|
mongo-init-replica:
|
||||||
|
image: mongo:4.0
|
||||||
|
command: >
|
||||||
|
bash -c
|
||||||
|
"for i in `seq 1 30`; do
|
||||||
|
mongo mongo/rocketchat --eval \"
|
||||||
|
rs.initiate({
|
||||||
|
_id: 'rs0',
|
||||||
|
members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
|
||||||
|
s=$$? && break || s=$$?;
|
||||||
|
echo \"Tried $$i times. Waiting 5 secs...\";
|
||||||
|
sleep 5;
|
||||||
|
done; (exit $$s)"
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
|
- nginx
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx:latest
|
||||||
|
container_name: webserver
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
- 443:443
|
||||||
|
volumes:
|
||||||
|
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
- ./nginx/ssl/:/ssl/
|
||||||
|
- ./nginx/ssl/:/etc/nginx/
|
||||||
|
#traefik:
|
||||||
|
# image: traefik:latest
|
||||||
|
# restart: unless-stopped
|
||||||
|
# command: >
|
||||||
|
# traefik
|
||||||
|
# --docker
|
||||||
|
# --acme=true
|
||||||
|
# --acme.domains='your.domain.tld'
|
||||||
|
# --acme.email='your@email.tld'
|
||||||
|
# --acme.entrypoint=https
|
||||||
|
# --acme.storagefile=acme.json
|
||||||
|
# --defaultentrypoints=http
|
||||||
|
# --defaultentrypoints=https
|
||||||
|
# --entryPoints='Name:http Address::80 Redirect.EntryPoint:https'
|
||||||
|
# --entryPoints='Name:https Address::443 TLS.Certificates:'
|
||||||
|
# ports:
|
||||||
|
# - 80:80
|
||||||
|
# - 443:443
|
||||||
|
# volumes:
|
||||||
|
# - /var/run/docker.sock:/var/run/docker.sock
|
|
@ -24,7 +24,7 @@
|
||||||
- name: copy docker compose to server
|
- name: copy docker compose to server
|
||||||
become_user: "{{ main_user }}"
|
become_user: "{{ main_user }}"
|
||||||
copy:
|
copy:
|
||||||
src: rocketchat/docker_compose.yml
|
src: files/docker_compose.yml
|
||||||
dest: /home/{{ main_user }}/rocketchat/
|
dest: /home/{{ main_user }}/rocketchat/
|
||||||
|
|
||||||
- name: bring down rocketchat docker-compose
|
- name: bring down rocketchat docker-compose
|
||||||
|
|
Loading…
Reference in New Issue