Skip to content

Commit f14a128

Browse files
authored
chore: devenv enhancements (#1000)
Fix QOL aliases and allow multiple devenvs to run simultanously.
1 parent 4393980 commit f14a128

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

docker-compose.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,26 @@ services:
1414
MYSQL_USER: admin
1515
MYSQL_PASSWORD: admin
1616
MYSQL_HOST: mysqldb
17-
ports:
18-
- "3306:3306"
1917
healthcheck:
2018
test: ["CMD", "mysql", "--user=admin", "--password=admin", "-e", "SELECT 1"]
2119
interval: 10s
2220
timeout: 10s
2321
retries: 3
2422
start_period: 20s
25-
container_name: mysqldb
2623
volumes:
2724
- var-run-mysqld:/var/run/mysqld
2825
redisdb:
2926
image: redis
3027
restart: always
31-
ports:
32-
- "6379:6379"
33-
container_name: redisdb
3428
memcached:
3529
image: memcached:latest
3630
restart: always
37-
ports:
38-
- "11211:11211"
39-
container_name: memcached
4031
postgres:
4132
image: postgres
4233
restart: always
4334
environment:
4435
POSTGRES_PASSWORD: root
4536
POSTGRES_USER: postgres
46-
ports:
47-
- "5432:5432"
48-
container_name: postgres
4937
php:
5038
platform: ${PLATFORM:-}
5139
image: newrelic/nr-php-agent-builder:make-php-${PHP:-8.2}-${LIBC:-gnu}-${IMAGE_VERSION:-v1}
@@ -106,7 +94,6 @@ services:
10694
working_dir: /usr/src/myapp
10795
stdin_open: true
10896
tty: true
109-
container_name: agent-devenv
11097
profiles: ["dev"]
11198

11299
volumes:

files/Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,18 @@ ENV PHP_VER=${PHP_VER}
142142
ARG PS1
143143
ENV PS1="New Relic > "
144144

145-
# QOL aliases
146-
# `rebuild` - make clean + make agent + make tests
147-
# `integ` - run all integration tests
148-
RUN echo 'alias integ="/usr/src/myapp/bin/integration_runner -agent /usr/src/myapp/agent/.libs/newrelic.so"' >> ~/.bashrc \
149-
&& echo 'alias rebuild="make -C agent clean && rm agent/Makefile && make && make tests"' >> ~/.bashrc
150-
151145
ARG USER=developer
152146
ARG UID=501
153147
ARG GID=20
154148
RUN useradd --uid ${UID} --gid ${GID} --shell /bin/bash --create-home ${USER}
155149
USER ${USER}
150+
# QOL aliases
151+
# `rebuild` - make clean + make agent + make tests
152+
# `integ` - run all integration tests
153+
RUN echo 'alias integ="/usr/src/myapp/bin/integration_runner -agent /usr/src/myapp/agent/.libs/newrelic.so"' >> ~/.bashrc \
154+
&& echo 'alias rebuild="make -C agent clean && rm agent/Makefile && make && make tests"' >> ~/.bashrc
156155
WORKDIR /usr/src/myapp
156+
# Avoid "fatal: detected dubious ownership in repository at '/usr/src/myapp/'" error
157+
# when running git commands inside container with host volume mounted:
158+
RUN git config --global --add safe.directory /usr/src/myapp/
157159
CMD ["bash"]

0 commit comments

Comments
 (0)