Commit 5f34c660 authored by aguestuser's avatar aguestuser
Browse files

Merge branch 'ns-fix-splashpage-deploy' into 'master'

[101|fixup] fix bugs in splash page deploy merged in #101

See merge request team-friendo/signalboost!90
parents ac248110 d55e65fd
......@@ -8,3 +8,4 @@ fi
ansible-galaxy install geerlingguy.docker
ansible-galaxy install geerlingguy.pip
ansible-galaxy install dev-sec.os-hardening
ansible-galaxy install dev-sec.ssh-hardening
......@@ -23,6 +23,7 @@
"stop": "docker-compose down",
"update": "./bin/dev/update",
"splash:dev": "cd splash && docker-compose -f docker-compose-dev.yml up",
"splash:build": "cd splash && docker-compose run --entrypoint 'gatsby build' splash",
"splash:prod": "cd splash && docker-compose up"
},
"engines": {
......
......@@ -7,6 +7,7 @@
NODE_ENV: production
vars:
rootdir: /srv
homedir: /srv/splash
env_file: "files/.env"
secrets_method: copy
......@@ -20,7 +21,7 @@
- name: Pull signalboost repository from 0xacab
git:
repo: https://0xacab.org/team-friendo/signalboost
dest: "{{ homedir }}"
dest: "{{ rootdir }}"
force: true
version: "{{ branch | default('master') }}"
tags: clone
......@@ -39,20 +40,31 @@
tags: clone
when: secrets_method == "copy"
#######################
# BUILD DOCKER IMAGES #
#######################
########################
# UPDATE DOCKER IMAGES #
########################
- name: Load base dockerfiles
copy:
src: files/docker/
dest: /srv/splash/docker/
tags: docker
# - name: Load base dockerfiles
# copy:
# src: files/docker/
# dest: /srv/splash/docker/
# tags: docker
# - name: Build splash container
# command: docker build -f /srv/splash/docker/signalboost_splash.dockerfile -t signalboost_splash:latest /srv/splash
# register: build_output
# tags: docker
####################
# UPDATE NODE DEPS #
####################
- name: Build splash container
command: docker build -f /srv/splash/docker/sigbalboost_splash.dockerfile -t signalboost_splash:latest /srv/splash
register: build_output
tags: docker
# - name: Install node packages
# command: "docker-compose run --entrypoint 'yarn install' splash"
# args:
# chdir: "{{ homedir }}"
# tags: prepare
########
# STOP #
......@@ -64,21 +76,6 @@
chdir: "{{ homedir }}"
tags: stop
###########
# PREPARE #
###########
- name: Install node packages
command: "docker-compose run --entrypoint 'yarn install' splash"
args:
chdir: "{{ homedir }}"
tags: prepare
- name: Stop container used for install
command: "docker-compose down"
args:
chdir: "{{ homedir }}"
tags: prepare
#########
# START #
......@@ -92,16 +89,3 @@
# - debug:
# var: docker_up_result
######################
# AVAILABILITY CHECK #
######################
- name: Ping nextcloud instance until it is available
shell: ./bin/check-availability
args:
chdir: "{{ homedir }}"
register: health_check_output
changed_when: false
failed_when: health_check_output.rc != 0
tags: health_check
......@@ -11,11 +11,6 @@
- name: docker
- name: docker-compose
# docker dependencies (ansible roles)
roles:
- geerlingguy.pip
- geerlingguy.docker
handlers:
- name: restart fail2ban
service: name=fail2ban state=restarted
......@@ -58,9 +53,23 @@
- lsof
- rsync
- python3
- python-pip
- emacs-nox
tags: packages
#################
# ENABLE DOCKER #
#################
- name: run pip role
import_role:
name: geerlingguy.pip
- name: run docker role
import_role:
name: geerlingguy.docker
######################
# ENABLE SWAP MEMORY #
######################
......@@ -119,6 +128,7 @@
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%sudo'
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
validate: visudo -cf %s
......@@ -145,7 +155,9 @@
# firewall
- ufw: state=enabled policy=allow
- ufw:
state: enabled
policy: allow
tags: ufw
- name: default (incoming) policy
......
#!/usr/bin/env bash
echo "--- running splash site..."
gatsby build && gatsby serve -H 0.0.0.0
gatsby serve -H 0.0.0.0
......@@ -6,11 +6,8 @@ services:
image: signalboost_splash
container_name: signalboost_splash
entrypoint: "gatsby develop -H 0.0.0.0"
env_file: .env
environment:
NODE_ENV: development
VIRTUAL_HOST: "$SPLASH_VIRTUAL_HOST"
LETSENCRYPT_HOST: "$SPLASH_LETSENCRYPT_HOST"
ports:
- 8000:8000
networks:
......
......@@ -15,20 +15,17 @@ services:
container_name: signalboost_splash
entrypoint: "/splash/bin/entrypoint/prod"
env_file: .env
environment:
NODE_ENV: development
VIRTUAL_HOST: "$SPLASH_VIRTUAL_HOST"
LETSENCRYPT_HOST: "$SPLASH_LETSENCRYPT_HOST"
ports:
- 9000:9000
networks:
- default
- proxy-tier
volumes:
- ./:/splash
restart: unless-stopped
proxy:
image: jwilder/nginx-proxy:alpien
image: jwilder/nginx-proxy:alpine
container_name: proxy
ports:
- 80:80
......
......@@ -101,4 +101,4 @@ RUN set -ex \
RUN yarn global add gatsby-cli
WORKDIR /signalboost
WORKDIR /splash
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment