Implemented draft four roulette wheel

This commit is contained in:
Kevin Veen-Birkenbach 2022-12-06 20:20:02 +01:00
parent aa64256207
commit ddb71f504b
8 changed files with 85 additions and 0 deletions

View File

@ -151,6 +151,14 @@
vars: vars:
domain: funkwhale.{{top_domain}} domain: funkwhale.{{top_domain}}
http_port: 8012 http_port: 8012
- name: setup roulette-wheel hosts
hosts: roulette_wheel_hosts
become: true
roles:
- role: docker-roulette-wheel
vars:
domain: roulette.{{top_domain}}
http_port: 8013
- name: setup akaunting hosts - name: setup akaunting hosts
hosts: akaunting_hosts hosts: akaunting_hosts
become: true become: true

View File

@ -0,0 +1,8 @@
---
- name: setup roulette-wheel
command:
cmd: docker-compose -p roulette-wheel up -d --force-recreate
chdir: "{{docker_compose_path}}"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600

View File

@ -0,0 +1,2 @@
dependencies:
- native-docker-reverse-proxy

View File

@ -0,0 +1,7 @@
# docker roulette-wheel
## further information
- https://github.com/p-wojt/roulette-wheel
- https://dev.to/ms314006/how-to-package-front-end-projects-into-docker-images-and-use-it-with-webpack-go3
- https://stackoverflow.com/questions/53178820/dockerfile-to-run-nodejs-static-content-in-docker-container
- https://stackoverflow.com/questions/43619644/i-am-getting-an-invalid-host-header-message-when-connecting-to-webpack-dev-ser

View File

@ -0,0 +1,41 @@
---
- name: recieve {{domain}} certificate
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
- name: configure {{domain}}.conf
template: src=roles/native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
notify: restart nginx
- name: "create {{docker_compose_path}}"
file:
path: "{{docker_compose_path}}"
state: directory
mode: 0755
#- name: register directory
# stat:
# path: "{{docker_compose_path}}"
# register: docker_compose_path_register
#
#- name: checkout repository
# ansible.builtin.shell: git checkout .
# become: true
# args:
# chdir: "{{docker_compose_path}}"
# when: docker_compose_path_register.stat.exists
- name: pull app repository
git:
repo: "https://github.com/p-wojt/roulette-wheel.git"
dest: "{{app_path}}"
update: yes
notify: setup roulette-wheel
become: true
- name: add docker-compose.yml
template: src=docker-compose.yml.j2 dest={{docker_compose_path}}docker-compose.yml
notify: setup roulette-wheel
- name: add Dockerfile
template: src=Dockerfile.j2 dest={{docker_compose_path}}Dockerfile
notify: setup roulette-wheel

View File

@ -0,0 +1,8 @@
FROM node:latest
WORKDIR /app
COPY {{app_path}}package.json ./
RUN npm install
COPY {{app_path}} ./
RUN npm run build
EXPOSE 8080
CMD ["npm", "run", "start"]

View File

@ -0,0 +1,9 @@
version: '3.7'
services:
application:
container_name: application
build:
context: .
ports:
- 127.0.0.1:{{http_port}}:8080
restart: unless-stopped

View File

@ -0,0 +1,2 @@
docker_compose_path: "/home/administrator/docker-compose/roulette-wheel/"
app_path: "/home/administrator/docker-compose/roulette-wheel/app"