Browse Source

Quito todo lo de nginx

politica
Celestino Rey 1 year ago
parent
commit
880e622c74
8 changed files with 3 additions and 137 deletions
  1. +1
    -1
      LyricsPy/K8S/lyrics-deployment.yaml
  2. +0
    -4
      LyricsPy/buildConComposeProd.sh
  3. +0
    -22
      LyricsPy/docker-compose.prod.yml
  4. +0
    -88
      LyricsPy/index antes bulmajs.html
  5. +2
    -2
      LyricsPy/servicios/creaImagen.sh
  6. +0
    -1
      LyricsPy/servicios/lyrics/paginas.py
  7. +0
    -4
      LyricsPy/servicios/nginx/Dockerfile
  8. +0
    -15
      LyricsPy/servicios/nginx/nginx.conf

+ 1
- 1
LyricsPy/K8S/lyrics-deployment.yaml View File

@ -36,7 +36,7 @@ spec:
- --bind
- 0.0.0.0:5000
- lyrics:create_app()
image: creylopez/lyrics:5.3
image: creylopez/lyrics:5.4
name: lyrics
ports:
- containerPort: 5000


+ 0
- 4
LyricsPy/buildConComposeProd.sh View File

@ -1,4 +0,0 @@
docker-compose -f docker-compose.prod.yml down
docker rmi lyricspy_lyrics
docker-compose -f docker-compose.prod.yml up -d --build

+ 0
- 22
LyricsPy/docker-compose.prod.yml View File

@ -1,22 +0,0 @@
version: '2.2'
services:
lyrics:
build: ./servicios
command: gunicorn --bind 0.0.0.0:5000 lyrics:create_app()
volumes:
- lyrics_prod:/instance
expose:
- 5000
# env_file:
# - ./.env.prod
nginx:
build: ./servicios/nginx
ports:
- 1338:80
depends_on:
- lyrics
volumes:
lyrics_prod:

+ 0
- 88
LyricsPy/index antes bulmajs.html View File

@ -1,88 +0,0 @@
{% extends 'base.html' %}
{% block content %}
<div class="tabs is-toggle is-fullwidth" id="tabs">
<!--
<button class="tablinks" onclick="openTab(event, 'Songs')">Songs</button>
<button class="tablinks" onclick="openTab(event, 'Albums')">Albums</button>
-->
<ul>
<li class="is-active" id="tablinks">
<a onclick="openTab(event, 'Songs')">
<span class="icon is-small"><i class="fa fa-image"></i></span>
<span>Canciones</span>
</a>
</li>
<li id="tablinks">
<a onclick="openTab(event, 'Albums')">
<span class="icon is-small"><i class="fa fa-music"></i></span>
<span>Álbumes</span>
</a>
</li>
</ul>
</div>
<div id="Songs" class="tabcontent is-active">
<h2>Song List</h2>
{% if songs %}
<table id="songTable" class="display">
<thead>
<tr>
<th>Pista</th>
<th>Título</th>
<th>Autor</th>
<th>Álbum</th>
</tr>
</thead>
<tbody>
{% for song in songs %}
<tr>
<td>{{ song.pista }}</td>
<td><a href="{{ url_for('paginas.song', song_id=song.id) }}">{{ song.title }}</a></td>
<td>{{ song.author }}</td>
<td><a href="{{ url_for('paginas.album', album_id=song.album.id) }}">{{ song.album.name }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No songs found.</p>
{% endif %}
</div>
<div id="Albums" class="tabcontent">
<h2>Album List</h2>
{% if albums %}
<table id="albumTable" class="display">
<thead>
<tr>
<th>Cover</th>
<th>Nombre</th>
<th>Artista</th>
<th>Año</th>
</tr>
</thead>
<tbody>
{% for album in albums %}
<tr>
<td>
{% if album.cover_image %}
<img src="{{ url_for('paginas.uploaded_file', filename=album.cover_image) }}" alt="{{ album.name }}" style="width:50px;height:50px;">
{% else %}
Sin imágen
{% endif %}
</td>
<td><a href="{{ url_for('paginas.album', album_id=album.id) }}">{{ album.name }}</a></td>
<td>{{ album.artist }}</td>
<td>{{ album.year }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No albums found.</p>
{% endif %}
<hr>
<a href="{{ url_for('paginas.add_album') }}" class="button">Añadir nuevo álbum</a>
</div>
{% endblock %}

+ 2
- 2
LyricsPy/servicios/creaImagen.sh View File

@ -1,3 +1,3 @@
docker build --no-cache -t creylopez/lyrics:5.3 .
docker push creylopez/lyrics:5.3
docker build --no-cache -t creylopez/lyrics:5.4 .
docker push creylopez/lyrics:5.4

+ 0
- 1
LyricsPy/servicios/lyrics/paginas.py View File

@ -80,6 +80,5 @@ def album(album_id):
return render_template('album.html', album=album, songs=songs)
@bp.route('/uploads/<filename>')
@login_required
def uploaded_file(filename):
return send_from_directory(current_app.config['UPLOAD_FOLDER'], filename)

+ 0
- 4
LyricsPy/servicios/nginx/Dockerfile View File

@ -1,4 +0,0 @@
FROM nginx:1.25
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d

+ 0
- 15
LyricsPy/servicios/nginx/nginx.conf View File

@ -1,15 +0,0 @@
upstream lyrics {
server lyrics:5000;
}
server {
listen 80;
location / {
proxy_pass http://lyrics;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}

Loading…
Cancel
Save