Skip to content

Commit

Permalink
Prepare Docker container for automated builds
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Dec 6, 2016
1 parent c0bf6e3 commit 7cb723f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node:
build: docker/Node
volumes:
- .:/workspace
12 changes: 12 additions & 0 deletions docker/Node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM fedora:latest

RUN curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
RUN dnf install -y git nodejs
RUN mkdir /home/docker-container-user
RUN mkdir /workspace
RUN useradd -d /home/docker-container-user -s /bin/bash docker-container-user
RUN npm install --global grunt-cli
RUN npm install --global bower

COPY ./init-container.sh /root/init-container.sh
WORKDIR /workspace
11 changes: 11 additions & 0 deletions docker/Node/init-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

# This script is to be executed when the docker container is started

# Set UID of user docker-container-user on guest to match the UID of the user on the host machine
usermod -u $(stat -c "%u" $1) docker-container-user
# Set GID of group docker-container-user on guest to match the GID of the users primary group on the host machine
groupmod -g $(stat -c "%g" $1) docker-container-user

chown -R docker-container-user /home/docker-container-user
chown -R docker-container-user /workspace

0 comments on commit 7cb723f

Please sign in to comment.