У меня есть файл docker, и файл docker составляет поле в моем каталоге проекта. Я запускаю файл docker compose с помощью следующей команды
docker-compose up
Он создает и запускает различные образы для сервера и базы данных, но я получаю сообщение об ошибке, в котором говорится, что мой файл package.json находится не в правильном каталоге. Я не уверен, где это идет не так.
Вот мой файл докера
FROM node:10
WORKDIR /app
COPY package.json ./app
RUN npm install
COPY . /app
CMD npm start
EXPOSE 5585
это мой файл для создания докера
web:
image: node
command: npm start
ports:
- "5585:5588"
links:
- db
working_dir: /app
environment:
SEQ_DB: addidas
SEQ_USER: sdfsdf
SEQ_PW: sdfsdfs
PORT: 4242
DATABASE_URL: postgres://sdfsdf:sdfsdfs@localhost:5432/addidas
db:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: sdfsdf
POSTGRES_PASSWORD: sdfsdfs
ошибка, которую я получаю в своем терминале, следующая:
Attaching to addidas_db_1, addidas_web_1
db_1 | The files belonging to this database system will be owned by user "postgres".
db_1 | This user must also own the server process.
db_1 |
db_1 | The database cluster will be initialized with locale "en_US.utf8".
db_1 | The default database encoding has accordingly been set to "UTF8".
db_1 | The default text search configuration will be set to "english".
db_1 |
db_1 | Data page checksums are disabled.
db_1 |
db_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1 | creating subdirectories ... ok
db_1 | selecting default max_connections ... 100
db_1 | selecting default shared_buffers ... 128MB
db_1 | selecting dynamic shared memory implementation ... posix
db_1 | creating configuration files ... ok
db_1 | running bootstrap script ... ok
db_1 | performing post-bootstrap initialization ... ok
db_1 | syncing data to disk ... ok
db_1 |
db_1 | Success. You can now start the database server using:
db_1 |
db_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1 |
db_1 |
db_1 | WARNING: enabling "trust" authentication for local connections
db_1 | You can change this by editing pg_hba.conf or using the option -A, or
db_1 | --auth-local and --auth-host, the next time you run initdb.
db_1 | waiting for server to start....2018-11-06 17:38:51.968 UTC [43] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2018-11-06 17:38:51.983 UTC [44] LOG: database system was shut down at 2018-11-06 17:38:51 UTC
db_1 | 2018-11-06 17:38:51.987 UTC [43] LOG: database system is ready to accept connections
db_1 | done
db_1 | server started
db_1 | CREATE DATABASE
db_1 |
db_1 |
db_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1 |
db_1 | waiting for server to shut down...2018-11-06 17:38:52.438 UTC [43] LOG: received fast shutdown request
db_1 | .2018-11-06 17:38:52.441 UTC [43] LOG: aborting any active transactions
db_1 | 2018-11-06 17:38:52.443 UTC [43] LOG: background worker "logical replication launcher" (PID 50) exited with exit code 1
db_1 | 2018-11-06 17:38:52.444 UTC [45] LOG: shutting down
db_1 | 2018-11-06 17:38:52.459 UTC [43] LOG: database system is shut down
db_1 | done
db_1 | server stopped
db_1 |
db_1 | PostgreSQL init process complete; ready for start up.
db_1 |
db_1 | 2018-11-06 17:38:52.556 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_1 | 2018-11-06 17:38:52.556 UTC [1] LOG: listening on IPv6 address "::", port 5432
db_1 | 2018-11-06 17:38:52.560 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2018-11-06 17:38:52.575 UTC [61] LOG: database system was shut down at 2018-11-06 17:38:52 UTC
db_1 | 2018-11-06 17:38:52.580 UTC [1] LOG: database system is ready to accept connections
db_1 | 2018-11-06 17:46:15.922 UTC [1] LOG: received smart shutdown request
db_1 | 2018-11-06 17:46:15.926 UTC [1] LOG: background worker "logical replication launcher" (PID 67) exited with exit code 1
db_1 | 2018-11-06 17:46:15.928 UTC [62] LOG: shutting down
db_1 | 2018-11-06 17:46:15.944 UTC [1] LOG: database system is shut down
db_1 | 2018-11-06 17:46:19.284 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_1 | 2018-11-06 17:46:19.284 UTC [1] LOG: listening on IPv6 address "::", port 5432
db_1 | 2018-11-06 17:46:19.288 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2018-11-06 17:46:19.309 UTC [24] LOG: database system was shut down at 2018-11-06 17:46:15 UTC
db_1 | 2018-11-06 17:46:19.316 UTC [1] LOG: database system is ready to accept connections
web_1 | npm ERR! path /app/package.json
web_1 | npm ERR! code ENOENT
web_1 | npm ERR! errno -2
web_1 | npm ERR! syscall open
web_1 | npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
web_1 | npm ERR! enoent This is related to npm not being able to find a file.
web_1 | npm ERR! enoent
web_1 |
web_1 | npm ERR! A complete log of this run can be found in:
web_1 | npm ERR! /root/.npm/_logs/2018-11-06T17_47_14_825Z-debug.log
addidas_web_1 exited with code 254