When I inherently go to make the connection from the python app inside the docker file I get .. I can ping and nslookup from indide the docker container from the terminal....so I'm a bit confused..
2023-08-12 01:30:45.665974(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='host.host.host')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='ADMTST')))DPY-6005: cannot connect to database. Connection failed with "[Errno -2] Name does not resolve"
Docker File:
FROM python:3-alpine
WORKDIR /app
COPY requirements.txt .
COPY package.json .
RUN apk add openldap-dev
RUN apk update && apk add python3-dev \
gcc \
libc-dev \
npm
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN python3 -m pip install -U "Cython<3.0.0"
RUN python3 -m pip install --no-build-isolation "oracledb==1.2.2"
RUN pip install -r requirements.txt
RUN npm install
COPY . .
RUN mv node_modules ./static/
EXPOSE 8000
CMD ["gunicorn","--access-logfile","LOGS/access_logs","--error-logfile","LOGS/error_logs","--certfile","tempSSL/certificate.pem","--keyfile","tempSSL/server.key","--workers","4", "-b", "0.0.0.0:8000", "wsgi:app"]
Docker Compose
version: '3.8'
services:
app:
build: .
ports:
- 8000:8000
- 1521:1521