From 75e5f54ab1ea5d70ae600136af8c9110a194ed08 Mon Sep 17 00:00:00 2001 From: joseelinchevalay Date: Thu, 16 Feb 2023 10:08:48 +0100 Subject: [PATCH] solve docker issue --- Dockerfile | 29 ----------------------------- docker-compose.yaml | 18 ++++-------------- python/Dockerfile | 5 +++-- requirements.txt | 4 ++-- 4 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a8aadea..0000000 --- a/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM debian:buster -LABEL version 1.0+beta.2 - -ENV JENKINS_HOME /var/jenkins -ENV DEBIAN_FRONTEND noninteractive -ENV REQUESTS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt - -#download through the french mirror -RUN sed -i 's/deb\./ftp.fr./' /etc/apt/sources.list - -RUN apt-get upgrade -y && apt-get update -RUN apt-get -y install \ - git \ - libnss-ldapd \ - libpam-ldapd \ - locales \ - maven \ - nfs-common \ - ntp \ - openjdk-8-jdk \ - openssh-server \ - python2.7 \ - sudo \ - supervisor \ - unzip \ - vim \ - wget \ - ca-certificates \ - nginx diff --git a/docker-compose.yaml b/docker-compose.yaml index 91733dc..555322a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,8 +8,6 @@ services: - 8080:8080 volumes: - data_ipfs:/data/ipfs - networks: - - db_networks db: image: postgres:10.7-alpine environment: @@ -19,32 +17,24 @@ services: - PGDATA=/var/lib/postgresql/data/pgdata volumes: - data_postgresql:/var/lib/postgresql/data/pgdata - networks: - - db_networks python: build: - context: ./python - entrypoint: bash -c "pip install -r requirements.txt && /code/run_app_prod.sh" + context: . + dockerfile: ./python/Dockerfile + entrypoint: bash -c "/code/run_app_prod.sh" environment: - - DATABASE_HOST=mazash_db_1.mazash_db_networks + - DATABASE_HOST=db - DATABASE_DB=dejavu - DATABASE_USER=postgres - DATABASE_PASSWORD=password - DATABASE_TYPE=postgres - IPFS_HOST=/dns/ipfs/tcp/5001 - volumes: - - .:/code - working_dir: /code ports: - 5000:5000 - 8600:8600 depends_on: - db - ipfs - networks: - - db_networks -networks: - db_networks: volumes: data_ipfs: data_postgresql: diff --git a/python/Dockerfile b/python/Dockerfile index 4155a6f..a9271be 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -7,6 +7,7 @@ RUN apt-get install \ useradd -m app RUN pip install --upgrade pip RUN pip install numpy scipy matplotlib pydub pyaudio psycopg2 uwsgi -RUN mkdir /code && chown app /code USER app -WORKDIR /code \ No newline at end of file +WORKDIR /code +COPY --chown=1000:1000 . /code +RUN pip install -r requirements.txt \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index ba89ff8..e72684a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ flask_swagger_ui openapi_spec_validator #dejavu -git+git://github.com/worldveil/dejavu@e56a4a221ad204654a191d217f92aebf3f058b62 +git+https://github.com/worldveil/dejavu@e56a4a221ad204654a191d217f92aebf3f058b62 #ipfs -git+git://github.com/ipfs-shipyard/py-ipfs-http-client.git@bcec97aa83cf0b0348d8e160c3f68dc8495dbc1b \ No newline at end of file +git+https://github.com/ipfs-shipyard/py-ipfs-http-client.git@bcec97aa83cf0b0348d8e160c3f68dc8495dbc1b \ No newline at end of file