Skip to content

Commit f3c5316

Browse files
committed
Merge branch 'release/1.1.1'
2 parents 9904b03 + a3b23dc commit f3c5316

File tree

11 files changed

+96
-4
lines changed

11 files changed

+96
-4
lines changed

docker/samson-deployment/latest/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ ADD crontab /etc/cron.d/webdevops-samson-deployment
195195

196196
RUN rake assets:precompile \
197197
&& /opt/docker/bin/control.sh service.enable cron \
198-
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-samson-deployment \
198+
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-base --role webdevops-base-app --role webdevops-samson-deployment \
199199
&& /opt/docker/bin/bootstrap.sh
200200

201201

202202
EXPOSE 80
203+
VOLUME /storage
203204

204205
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
205206
CMD ["supervisord"]

docker/samson-deployment/latest/Dockerfile.jinja2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
{{ samsonDeployment.general() }}
3939

4040
{{ docker.expose('80') }}
41+
{{ docker.volume('/storage') }}
4142

4243
{{ docker.entrypoint("/opt/docker/bin/entrypoint.sh") }}
4344
{{ docker.cmd("supervisord") }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Prevent startup of nginx (ubuntu 16.04 needs it)
2+
ln -f -s /var/lib/nginx/logs /var/log/nginx
3+
4+
# Replace markers
5+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<ALIAS_DOMAIN>" "$WEB_ALIAS_DOMAIN"
6+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<SERVERNAME>" "$HOSTNAME"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
source /opt/docker/bin/config.sh
4+
5+
includeScriptDir "/opt/docker/bin/service.d/nginx.d/"
6+
7+
exec /usr/sbin/nginx

docker/samson-deployment/latest/conf/etc/supervisor.d/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ programs=nginxd
33
priority=20
44

55
[program:nginxd]
6-
command = /usr/sbin/nginx
6+
command = /opt/docker/bin/service.d/nginx.sh
77
process_name=%(program_name)s
88
startsecs = 0
99
autostart = true

docker/samson-deployment/latest/conf/provision/roles/webdevops-samson-deployment/tasks/bootstrap.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,35 @@
3535
group: "{{ APPLICATION_GROUP }}"
3636
mode: u=rwX,g=rX,o=rX
3737
recurse: yes
38+
39+
- name: Remove old log directory
40+
file:
41+
path: "/var/lib/nginx/logs"
42+
state: absent
43+
44+
- name: Create log directory
45+
file:
46+
path: "/var/lib/nginx/logs"
47+
state: directory
48+
49+
- name: Create stdout symlinks
50+
file:
51+
dest: "{{ item }}"
52+
src: "/docker.stdout"
53+
state: link
54+
force: yes
55+
with_items:
56+
- "/var/lib/nginx/logs/access.log"
57+
- "/var/lib/nginx/logs/error.log"
58+
59+
- name: Create storage directories
60+
file:
61+
path: "{{ item }}"
62+
state: directory
63+
owner: "{{ APPLICATION_USER }}"
64+
group: "{{ APPLICATION_GROUP }}"
65+
mode: u=rwX,g=rX,o=rX
66+
recurse: yes
67+
with_items:
68+
- "/storage"
69+
- "/storage/db"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Prevent startup of nginx (ubuntu 16.04 needs it)
2+
ln -f -s /var/lib/nginx/logs /var/log/nginx
3+
4+
# Replace markers
5+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<ALIAS_DOMAIN>" "$WEB_ALIAS_DOMAIN"
6+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<SERVERNAME>" "$HOSTNAME"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
source /opt/docker/bin/config.sh
4+
5+
includeScriptDir "/opt/docker/bin/service.d/nginx.d/"
6+
7+
exec /usr/sbin/nginx

provisioning/samson-deployment/general/etc/supervisor.d/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ programs=nginxd
33
priority=20
44

55
[program:nginxd]
6-
command = /usr/sbin/nginx
6+
command = /opt/docker/bin/service.d/nginx.sh
77
process_name=%(program_name)s
88
startsecs = 0
99
autostart = true

provisioning/samson-deployment/general/provision/roles/webdevops-samson-deployment/tasks/bootstrap.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,35 @@
3535
group: "{{ APPLICATION_GROUP }}"
3636
mode: u=rwX,g=rX,o=rX
3737
recurse: yes
38+
39+
- name: Remove old log directory
40+
file:
41+
path: "/var/lib/nginx/logs"
42+
state: absent
43+
44+
- name: Create log directory
45+
file:
46+
path: "/var/lib/nginx/logs"
47+
state: directory
48+
49+
- name: Create stdout symlinks
50+
file:
51+
dest: "{{ item }}"
52+
src: "/docker.stdout"
53+
state: link
54+
force: yes
55+
with_items:
56+
- "/var/lib/nginx/logs/access.log"
57+
- "/var/lib/nginx/logs/error.log"
58+
59+
- name: Create storage directories
60+
file:
61+
path: "{{ item }}"
62+
state: directory
63+
owner: "{{ APPLICATION_USER }}"
64+
group: "{{ APPLICATION_GROUP }}"
65+
mode: u=rwX,g=rX,o=rX
66+
recurse: yes
67+
with_items:
68+
- "/storage"
69+
- "/storage/db"

0 commit comments

Comments
 (0)