diff --git a/docker-compose.yaml b/docker-compose.yaml index 21044c7c7..b99c89dc0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,38 +14,26 @@ services: MYSQL_USER: admin MYSQL_PASSWORD: admin MYSQL_HOST: mysqldb - ports: - - "3306:3306" healthcheck: test: ["CMD", "mysql", "--user=admin", "--password=admin", "-e", "SELECT 1"] interval: 10s timeout: 10s retries: 3 start_period: 20s - container_name: mysqldb volumes: - var-run-mysqld:/var/run/mysqld redisdb: image: redis restart: always - ports: - - "6379:6379" - container_name: redisdb memcached: image: memcached:latest restart: always - ports: - - "11211:11211" - container_name: memcached postgres: image: postgres restart: always environment: POSTGRES_PASSWORD: root POSTGRES_USER: postgres - ports: - - "5432:5432" - container_name: postgres php: platform: ${PLATFORM:-} image: newrelic/nr-php-agent-builder:make-php-${PHP:-8.2}-${LIBC:-gnu}-${IMAGE_VERSION:-v1} @@ -106,7 +94,6 @@ services: working_dir: /usr/src/myapp stdin_open: true tty: true - container_name: agent-devenv profiles: ["dev"] volumes: diff --git a/files/Dockerfile b/files/Dockerfile index 3081cf1ab..cb52536ef 100644 --- a/files/Dockerfile +++ b/files/Dockerfile @@ -142,16 +142,18 @@ ENV PHP_VER=${PHP_VER} ARG PS1 ENV PS1="New Relic > " -# QOL aliases -# `rebuild` - make clean + make agent + make tests -# `integ` - run all integration tests -RUN echo 'alias integ="/usr/src/myapp/bin/integration_runner -agent /usr/src/myapp/agent/.libs/newrelic.so"' >> ~/.bashrc \ - && echo 'alias rebuild="make -C agent clean && rm agent/Makefile && make && make tests"' >> ~/.bashrc - ARG USER=developer ARG UID=501 ARG GID=20 RUN useradd --uid ${UID} --gid ${GID} --shell /bin/bash --create-home ${USER} USER ${USER} +# QOL aliases +# `rebuild` - make clean + make agent + make tests +# `integ` - run all integration tests +RUN echo 'alias integ="/usr/src/myapp/bin/integration_runner -agent /usr/src/myapp/agent/.libs/newrelic.so"' >> ~/.bashrc \ + && echo 'alias rebuild="make -C agent clean && rm agent/Makefile && make && make tests"' >> ~/.bashrc WORKDIR /usr/src/myapp +# Avoid "fatal: detected dubious ownership in repository at '/usr/src/myapp/'" error +# when running git commands inside container with host volume mounted: +RUN git config --global --add safe.directory /usr/src/myapp/ CMD ["bash"]