skip to Main Content

Problem connecting to the PostgresSQL from Docker

Sample from class: try: conn = psycopg2.connect( database='ytbstatsdb', host='127.0.0.1', user='admin', password='admin123', port='5432' ) except psycopg2.Error as e: print(e) cursor = conn.cursor() engine = sqlalchemy.create_engine('postgresql://admin:admin123@localhost:5432/ytbstatsdb') df_videos_details.to_sql('testtable', engine, if_exists='replace', index=False) Docker file (docker-compose.yaml): services: db: image: postgres ports: - 5432:5432 restart: always…

VIEW QUESTION

docker compose up 'unable to access jarfile'

i trying run my application with docker Dockerfile FROM openjdk:latest CMD ["./mvmw", "clean", "package"] COPY target/doIt-0.0.1.jar app.jar RUN chmod 755 app.jar ENTRYPOINT ["java", "-jar", "app.jar"] docker-compose.yml version: '3' services: application: container_name: doIt_service build: dockerfile: Dockerfile ports: - "8081:8081" volumes: -…

VIEW QUESTION
Back To Top
Search