Skip to content

Commit

Permalink
Workdir change
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommi Liittokivi committed Aug 7, 2017
1 parent 4e8208e commit f59ce2d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:6.10-alpine
MAINTAINER Conmio developers
RUN apk --no-cache update && \
apk --no-cache add less bash make curl su-exec

COPY script/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 755 /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
WORKDIR /home/user

FROM node:6.10-alpine
MAINTAINER Conmio developers
RUN apk --no-cache update && \
apk --no-cache add less bash make curl openssl su-exec

COPY script/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 755 /usr/local/bin/entrypoint.sh

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

#### Running node.js script:
```
docker run --rm -it \
docker run --rm \
-e LOCAL_USER_ID=`id -u $USER`\
-v ~/my_local_folder:/home/user/project \
-w /home/user/project \
-v ~/script_folder:/app \
conmio/node node script.js
```
---
Expand Down
2 changes: 1 addition & 1 deletion script/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Either use the LOCAL_USER_ID if passed in at runtime or fallback
USER_ID=${LOCAL_USER_ID:-9001}
echo "Starting with UID : $USER_ID"

# if user with given ID already exists, remove it
USER_NAME=$(getent passwd "$USER_ID" | cut -d: -f1)
Expand All @@ -13,6 +12,7 @@ fi
# Add local user
adduser -D -u $USER_ID user
export HOME=/home/user
chown user /app

if [ -z $1 ]; then
exec su-exec user bash
Expand Down

0 comments on commit f59ce2d

Please sign in to comment.