docker exec -i -t 3а3 bash
env
...
POSTGRES_PASSWORD=123
POSTGRES_USER=d_user
...
export PASSWORD_FOR_DOCKER=123 USER_FOR_DOCKER=d_user; docker-compose up -d
docker inspect 3f3
.......
"Env": [
"POSTGRES_USER=d_user",
"POSTGRES_PASSWORD=123",
"POSTGRES_DB=db_docker",
.........
... port 5432 failed: FATAL: password authentication failed for user "d_user"
var token = /access_token=([^&]+)/.exec(document.location.hash)[1];
docker-compose down
- ./db:/var/lib/postgresql/data/pgdata
- ./db:/var/lib/postgresql/data
#command: mkdir db
command: python wsgi.py
docker-compose up -d
#command: mkdir db
).# command: python wsgi.py
)docker-compose up -d
:docker ps -a
sudo systemctl restart docker
command: python wsgi.py
version: '3'
services:
app:
build: ./app
links:
- db
restart: always
volumes:
- ./app:/app
ports:
- 106:5000
#CMD ["python", "wsgi_docker.py"]
depends_on:
- db
container_name: postgres_app
command: python wsgi.py
nginx:
build: ./nginx
container_name: postgres_nginx
restart: always
ports:
- 109:85
depends_on:
- app
db:
command: mkdir db
image: postgres:14.6
container_name: postgres-db
#restart: always
environment:
POSTGRES_PASSWORD: "example"
POSTGRES_DB: "db_docker"
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- "5432:5432"
#expose:
# - 5432
volumes:
- ./db:/var/lib/postgresql/data/pgdata
- ./setting/init.sql:/docker-entrypoint-initdb.d/init.sql
#command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
adminer:
depends_on:
- db
image: adminer
container_name: postgres_adminer
restart: always
ports:
- 107:8080
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "postgres-db" to address: Temporary failure in name resolution
environ({
'LANG': 'ru_RU.UTF-8',
'PATH': '/home/USER_FOLDER/APP_FOLDER/myprojectenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
'HOME': '/home/USER_FOLDER',
'LOGNAME': 'USER_NAME',
'USER': 'USER_NAME',
'SHELL': '/bin/bash',
'INVOCATION_ID': '5bd672........a01f',
'JOURNAL_STREAM': '9:105....',
'SERVER_SOFTWARE': 'gunicorn/20.1.0'})
printenv:
LS_COLORS=.........:
SSH_CONNECTION=.............
LESSCLOSE=/usr/bin/lesspipe %s %s
LANG=ru_RU.UTF-8
XDG_SESSION_ID=...
USER=USER_NAME
PWD=/home/USER_FOLDER/APP_FOLDER
HOME=/home/USER_FOLDER
SSH_CLIENT=............
SSH_TTY=/dev/pts/1
MAIL=/var/mail/USER_NAME
TERM=...
SHELL=/bin/bash
SHLVL=1
LOGNAME=USER_NAME
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
PATH=/home/USER_FOLDER/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
LESSOPEN=| /usr/bin/lesspipe %s
_=/usr/bin/printenv
OLDPWD=/home/USER_FOLDER