Skip to content

Commit

Permalink
SSH Client, VOLUMES versatility, cleaner logs (#24)
Browse files Browse the repository at this point in the history
* Resolves #12 to add ssh client

* Resolves #23 to remove forcing VOLUMES
Also redirects logs to stdout, for viewing via native docker logs
  • Loading branch information
LBegnaud committed Feb 16, 2020
1 parent 35ae1bd commit 60c1eee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ services:
volumes:
- "./netdisco/nd-site-local:/home/netdisco/nd-site-local"
- "./netdisco/config:/home/netdisco/environments"
- "./netdisco/logs:/home/netdisco/logs"
# logs are symlinked to stdout
# - "./netdisco/logs:/home/netdisco/logs"
environment:
NETDISCO_DOMAIN: discover
NETDISCO_DB_HOST: netdisco-postgresql
Expand Down
9 changes: 7 additions & 2 deletions netdisco-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apk add --no-cache \
perl-io-socket-ssl \
perl-ldap \
postgresql-client \
openssh-client \
wget && \
apk fix --no-cache perl perl-dev

Expand Down Expand Up @@ -65,7 +66,10 @@ RUN groupadd -r netdisco -g 901 && \

USER netdisco:netdisco
RUN for tgt in bin environments nd-site-local logs; \
do mkdir /home/netdisco/$tgt; done
do mkdir /home/netdisco/$tgt; done && \
ln -s /dev/stdout /home/netdisco/logs/netdisco-backend.log && \
ln -s /dev/stdout /home/netdisco/logs/netdisco-web.log


COPY --chown=netdisco:netdisco --from=netdisco-builder-image \
/home/netdisco-build /home/netdisco/
Expand All @@ -83,6 +87,7 @@ WORKDIR /home/netdisco
ENV PATH "/home/netdisco/bin:$PATH"
ENV SHELL /bin/ash

VOLUME ["/home/netdisco/environments", "/home/netdisco/nd-site-local", "/home/netdisco/logs"]
## volumes can be optional, and controlled by docker-compose file
# VOLUME ["/home/netdisco/environments", "/home/netdisco/nd-site-local", "/home/netdisco/logs"]

CMD ["ash"]

0 comments on commit 60c1eee

Please sign in to comment.