[WIP] minor improvements to ENV config

convert_back_2_python
Akros 3 days ago
parent 56565c7643
commit 1d031ce959

@ -6,6 +6,8 @@ services:
context: ./python
dockerfile: dockerfiles/python.dockerfile
args:
- USER=${USER:-app}
- GROUP=${GROUP:-app}
- UID=${UID:-1000}
- GID=${GID:-1000}
command: python3 app.py
@ -13,7 +15,6 @@ services:
- "5000:5000"
volumes:
- ./python:/python:Z
- ./php/src:/var/www/html:delegated
depends_on:
- redis
networks:
@ -23,11 +24,11 @@ services:
container_name: get_discography_postgres
image: postgres:12
ports:
- "5432:5432"
- "${DB_PORT:-5432}:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=temp_pg_pass
- POSTGRES_USER=odoo
- POSTGRES_DB=${DB_NAME:-postgres}
- POSTGRES_PASSWORD=${DB_PASS:-password}
- POSTGRES_USER=${DB_USER:-pg_admin}
- PGDATA=/var/lib/postgresql/data/pgdata
networks:
- lan

@ -1,5 +1,9 @@
DB_HOST=localhost
USER=app
GROUP=app
UID=1000
GID=1000
DB_HOST=docker.host.internal
DB_PORT=5432
DB_NAME=postgres
DB_USER=postgres
DB_USER=pg_admin
DB_PASS=password

@ -1,6 +1,5 @@
import requests
from utils.download import download_album
import json
def process_artist_queue():

@ -9,14 +9,14 @@ RUN pip3 install -r requirements.txt
ENV FLASK_APP=app
# Set user and group
ARG user=app
ARG group=app
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group}
RUN useradd -u ${uid} -g ${group} -s /bin/sh -m ${user}
ARG USER=app
ARG GROUP=app
ARG UID=1000
ARG GID=1000
RUN groupadd -g ${GID} ${GROUP}
RUN useradd -u ${UID} -g ${GROUP} -s /bin/sh -m ${USER}
# Switch to user
USER ${uid}:${gid}
USER ${UID}:${GID}
CMD ["python3","-u","app.py"]

@ -13,7 +13,7 @@ import time
# ----------------------------------------------------
musicbrainzngs.set_useragent(
name="getDiscography",
version="0.1",
version="0.3",
contact="akros@voxelixia.com"
)

@ -1,7 +1,4 @@
from __future__ import annotations
import os
import sys
from typing import Any, Dict, Iterable, List, Optional, Tuple
import psycopg2

Loading…
Cancel
Save