Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: devenv enhancements #1000

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -106,7 +94,6 @@ services:
working_dir: /usr/src/myapp
stdin_open: true
tty: true
container_name: agent-devenv
profiles: ["dev"]

volumes:
Expand Down
14 changes: 8 additions & 6 deletions files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading