Browse Source

añado ficheros para docker. Probar en linux

politica
Celestino Rey 1 year ago
parent
commit
041614e1b1
6 changed files with 68 additions and 0 deletions
  1. +24
    -0
      LyricsPy/Dockerfile
  2. +3
    -0
      LyricsPy/buildConComposeProd.sh
  3. +22
    -0
      LyricsPy/docker-compose.prod.yml
  4. BIN
      LyricsPy/instance/songs.db
  5. +4
    -0
      LyricsPy/nginx/Dockerfile
  6. +15
    -0
      LyricsPy/nginx/nginx.conf

+ 24
- 0
LyricsPy/Dockerfile View File

@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1
FROM python:3.8-slim-buster
WORKDIR /
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install system dependencies
RUN apt-get update && apt-get install -y sqlite3
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
# CMD [ "python3", "-m" , "flask", "--app", "padel", "run", "--host=0.0.0.0"]
#CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
# run entrypoint.sh
ENTRYPOINT ["/padel/entrypoint.sh"]

+ 3
- 0
LyricsPy/buildConComposeProd.sh View File

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

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

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

BIN
LyricsPy/instance/songs.db View File


+ 4
- 0
LyricsPy/nginx/Dockerfile View File

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

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

@ -0,0 +1,15 @@
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