Я пытался сделать docker-compose up
из моего Dockerfile, но это не удалось с ошибкой standard_init_linux.go:207: exec user process caused "no such file or directory"
Я уже попробовал все, включая переустановку докера, но, похоже, он не работает.
докер-compose.yml:
version: "3"
volumes:
postgres_data:
driver: local
bundle_cache:
driver: local
services:
postgres:
image: postgres:11
volumes:
- postgres_data:/var/lib/postgresql/data
logging:
driver: "none"
ports:
- "${POSTGRES_PORT}:5432"
web-tracking:
build:
context: .
tty: true
stdin_open: true
env_file:
- ./.env
depends_on:
- postgres
links:
- postgres
ports:
- "${RAILS_PORT}:3000"
volumes:
- ./:/app:delegated
- bundle_cache:/bundle
Dockerfile:
FROM ruby:2.6.3
EXPOSE 3000
WORKDIR ./app
RUN \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
nodejs \
postgresql-client
ENV BUNDLE_PATH=/bundle \
BUNDLE_BIN=/bundle/bin \
GEM_HOME=/bundle
ENV PATH="${BUNDLE_BIN}:${PATH}"
COPY docker-entry.sh .
ENTRYPOINT ["/app/docker-entry.sh"]
CMD ["rails", "server", "-b", "0.0.0.0"]
docker-entry.sh
#!/bin/sh
set -e
# if the server was not shut down properly the pid file will need to be removed
if [ -f tmp/pids/server.pid ]; then
rm tmp/pids/server.pid
fi
bundle install
bundle exec "$@"