mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed server_ for better overview
This commit is contained in:
8
roles/docker-roulette-wheel/handlers/main.yml
Normal file
8
roles/docker-roulette-wheel/handlers/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: recreate and build roulette-wheel
|
||||
command:
|
||||
cmd: docker-compose -p roulette-wheel up -d --force-recreate --build
|
||||
chdir: "{{docker_compose_path}}"
|
||||
environment:
|
||||
COMPOSE_HTTP_TIMEOUT: 600
|
||||
DOCKER_CLIENT_TIMEOUT: 600
|
2
roles/docker-roulette-wheel/meta/main.yml
Normal file
2
roles/docker-roulette-wheel/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- server_native-docker-reverse-proxy
|
7
roles/docker-roulette-wheel/readme.md
Normal file
7
roles/docker-roulette-wheel/readme.md
Normal 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-server_docker-images-and-use-it-with-webpack-go3
|
||||
- https://stackoverflow.com/questions/53178820/dockerfile-to-run-nodejs-static-content-in-server_docker-container
|
||||
- https://stackoverflow.com/questions/43619644/i-am-getting-an-invalid-host-header-message-when-connecting-to-webpack-dev-ser
|
36
roles/docker-roulette-wheel/tasks/main.yml
Normal file
36
roles/docker-roulette-wheel/tasks/main.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- 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/server_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: pull app repository
|
||||
git:
|
||||
repo: "https://github.com/kevinveenbirkenbach/roulette-wheel.git"
|
||||
dest: "{{app_path}}"
|
||||
update: yes
|
||||
notify: recreate and build roulette-wheel
|
||||
become: true
|
||||
register: git_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Warn if repo is not reachable
|
||||
debug:
|
||||
msg: "Warning: Repository is not reachable."
|
||||
when: git_result.failed
|
||||
|
||||
- name: add docker-compose.yml
|
||||
template: src=docker-compose.yml.j2 dest={{docker_compose_path}}docker-compose.yml
|
||||
notify: recreate and build roulette-wheel
|
||||
|
||||
- name: add Dockerfile
|
||||
template: src=Dockerfile.j2 dest={{docker_compose_path}}Dockerfile
|
||||
notify: recreate and build roulette-wheel
|
7
roles/docker-roulette-wheel/templates/Dockerfile.j2
Normal file
7
roles/docker-roulette-wheel/templates/Dockerfile.j2
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM node:latest
|
||||
WORKDIR /app
|
||||
COPY ./app/package.json ./
|
||||
RUN npm install
|
||||
COPY ./app/ ./
|
||||
RUN npm run build
|
||||
CMD ["npm", "run", "start"]
|
@@ -0,0 +1,9 @@
|
||||
version: '3.7'
|
||||
services:
|
||||
application:
|
||||
container_name: application
|
||||
build:
|
||||
context: .
|
||||
ports:
|
||||
- 127.0.0.1:{{http_port}}:8080
|
||||
restart: always
|
2
roles/docker-roulette-wheel/vars/main.yml
Normal file
2
roles/docker-roulette-wheel/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
docker_compose_path: "{{path_docker_compose_files}}roulette-wheel/"
|
||||
app_path: "{{path_docker_compose_files}}roulette-wheel/app/"
|
Reference in New Issue
Block a user