Skip to content

Commit

Permalink
add development images to docker-compose
Browse files Browse the repository at this point in the history
This allows me to mount the src directory into the Docker container and
use Morbo to auto-restart, making development easier!
  • Loading branch information
preaction committed Jan 10, 2020
1 parent d9759fc commit b21a98f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,19 @@ RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/s
libdbd-mysql-perl \
libdbd-sqlite3-perl

COPY ./wait-for-it.sh ./wait-for-it.sh
RUN chmod +x ./wait-for-it.sh
COPY ./wait-for-it.sh /root/wait-for-it.sh
RUN chmod +x /root/wait-for-it.sh

# Add all distributions in the "dist" directory before any other
# distributions. This way we can have pre-release modules in our dev
# environment. Do this last to take advantage of as much caching as
# possible above, even though any changes here mean rebuilding every
# downstream image...
COPY ./dist ./dist
RUN bash -vlc 'for DIST in ./dist/*; do \
COPY ./dist /root/dist
RUN bash -vlc 'for DIST in /root/dist/*; do \
echo "Building pre-release: $DIST"; \
cpanm -v --notest $DIST; \
done && rm -rf ./dist'
done && rm -rf /root/dist'

RUN mkdir /app
WORKDIR /app
8 changes: 4 additions & 4 deletions Dockerfile.deploy
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM cpantesters/schema
RUN apt-get update && apt-get install -y default-mysql-client
COPY etc/docker/deploy-db.sh ./deploy-db.sh
COPY etc/docker/mysql.conf ./.cpanstats.cnf
COPY var/schema/metabase-schema.sql ./metabase-schema.sql
COPY var/schema/legacy-schema.sql ./legacy-schema.sql
COPY etc/docker/deploy-db.sh /app/deploy-db.sh
COPY etc/docker/mysql.conf /root/.cpanstats.cnf
COPY var/schema/metabase-schema.sql /app/metabase-schema.sql
COPY var/schema/legacy-schema.sql /app/legacy-schema.sql
RUN chmod +x deploy-db.sh
CMD [ './deploy-db.sh' ]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ data:
@echo "Fetching data for $(DIST)"
@docker-compose run deploy cpantesters-schema fetch --dist $(DIST) report release

daemon:
@COMPOSE_FILE="docker-compose.yml:docker-compose.devel.yml" \
docker-compose build && docker-compose up
6 changes: 6 additions & 0 deletions docker-compose.devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
web:
volumes:
- ./src/cpantesters-web:/app
command: [ "morbo", "bin/cpantesters-web" ]

0 comments on commit b21a98f

Please sign in to comment.