docker-compose

Copy file(s) within the container in Dockerfile

随声附和 提交于 2021-01-28 22:50:42
问题 How can I copy a file from a path within the container to a different path within that same container in a Dockerfile during the docker-compose build process? COPY <src> <dest> This copies a file from the host outside the container. I don't know how to have <src> specify a file inside the container to copy. 回答1: as @tkausl and @JohnKugelman pointed out files can be copied by the following command syntax: RUN cp <src-path-within-the-container> <dest-path-within-the-container> 来源: https:/

What should I add as api-address when within a multi-container docker-compose setup?

别来无恙 提交于 2021-01-28 21:59:26
问题 I have a simple 2 container docker-compose setup. A frontend (Angular) and a backend (nestjs/express). Here's my docker-compose (development) version: "3.3" services: db: image: 'postgres:10-alpine' container_name: 'postgresnew' environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=4321 - POSTGRES_DB=bleh volumes: - pgdata:/var/lib/postgresql/data frontend: build: ./frontendapp ports: - 4001:4200 volumes: - ./frontendapp:/app - /app/node_modules/ backend: build: ./backendapp ports: - 4000

Docker dpage/pgadmin4 error: specified user does not exist

孤人 提交于 2021-01-28 20:08:01
问题 This is the docker-compose.yml file: version: '3' services: ############################ # Setup database container # ############################ postgres_db: image: postgres restart: always ports: - ${POSTGRES_PORT}:${POSTGRES_PORT} environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - PGDATA=/var/lib/postgresql/data/pgdata - POSTGRES_DB=${POSTGRES_DB} volumes: - ./data:/var/lib/postgresql/data networks: - db_network pgadmin: image: dpage/pgadmin4:4.19

Mysql Connection Error In Docker with Spriing boot

我怕爱的太早我们不能终老 提交于 2021-01-28 18:55:25
问题 I have started with docker and I am creating some basic examples. I am facing problem between spring boot and mysql connection when I am using docker-copmose.yml file. The weird thing is that it's giving error at jdbc:mysql. It's considering second argument of database connection as host. I am not sure why ? This same connection confg works when I manually start mysql and springboot container individually. I am facing this problem only when I use docker-compose application.properties spring

Python psql \copy CSV to remote server

人走茶凉 提交于 2021-01-28 13:02:11
问题 I am attempting to copy a csv (which has a header and quote character ") with python 3.6 to a table on a remote postgres 10 server. It is a large CSV (2.5M rows, 800MB) and while I previously imported it into a dataframe and then used dataframe.to_sql, this was very memory intensive so I switched to using COPY. Using COPY with psycopg2 or sqlalchemy would work fine but the remote server does not have access to the local file system. Using psql in the terminal I have successfully run the query

Python psql \copy CSV to remote server

左心房为你撑大大i 提交于 2021-01-28 13:01:37
问题 I am attempting to copy a csv (which has a header and quote character ") with python 3.6 to a table on a remote postgres 10 server. It is a large CSV (2.5M rows, 800MB) and while I previously imported it into a dataframe and then used dataframe.to_sql, this was very memory intensive so I switched to using COPY. Using COPY with psycopg2 or sqlalchemy would work fine but the remote server does not have access to the local file system. Using psql in the terminal I have successfully run the query

Not able to deploy to Kubernetes cluster using Kompose

我们两清 提交于 2021-01-28 12:15:31
问题 I'm currently deploying a project on a kubernetes cluster by using Kompose (http://www.kompose.io) to convert the docker-compose configuration to kubernetes configuration files. This is a project for a master class at my university and they took care of the kubernetes cluster, so I'm almost certain that the configuration for it is done properly. FYI, this is the version of that kubernetes cluster; $ kubectl version Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3",

How do I limit resources for ffmpeg, called from a python-script, running in a docker container?

…衆ロ難τιáo~ 提交于 2021-01-28 11:44:48
问题 I deployed a service, that periodically does video encoding on my server; And every time it does, all other services slow down significantly. The encoding is hidden under multiple layers of abstraction. Limiting any of those layers would be fine. (e.g. limiting the docker-container would work just as well as limiting the ffmpeg-sub process.) My Stack: VPS (ubuntu:zesty) docker-compose docker-container (ubuntu:zesty) python ffmpeg (via subprocess.check_call() in python) What I want to limit:

How to access Docker container app on local?

爱⌒轻易说出口 提交于 2021-01-28 11:30:23
问题 I have a simple Node.js/Express app: const port = 3000 app.get('/', (req, res) => res.send('Hello World!')) app.listen(port, () => console.log(`Example app listening on port ${port}!`)) It works fine when I start it like: node src/app.js Now I'm trying to run it in a Docker container. Dockerfile is: FROM node:8 WORKDIR /app ADD src/. /app/src ADD package.json package-lock.json /app/ RUN npm install COPY . /app EXPOSE 3000 CMD [ "node", "src/app.js" ] It starts fine: docker run <my image>:

Docker for WordPress slow

我们两清 提交于 2021-01-28 10:57:08
问题 Problem : I have a problem with WordPress & Docker because the slow loading time (+- 7 seconds) of my website. I am not sure why this happends but I think it has something to do with the external database or the shared volumes. Setup: I have a custom Dockerfile built on WordPress with XDebug and Mailhog. This Dockerfile is included within my docker-compose.yml, the other services my docker-compose contains are WP-CLI and Mailhog. My Database is hosted on an Amazon RDS so I can share it with