-
-
Save hibiarata/07a6b2e31897049b0ccf9f1526e4ae8b to your computer and use it in GitHub Desktop.
Starter Dockerfile with ZSH (NodeJS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup Stage - set up the ZSH environment for optimal developer experience | |
FROM node:14-alpine AS setup | |
# Let scripts know we're running in Docker (useful for containerised development) | |
ENV RUNNING_IN_DOCKER true | |
# Use the unprivileged `node` user (pre-created by the Node image) for safety (and because it has permission to install modules) | |
RUN mkdir -p /app \ | |
&& chown -R node:node /app | |
# Set up ZSH and our preferred terminal environment for containers | |
RUN apk --no-cache add zsh curl git | |
RUN mkdir -p /home/node/.antigen | |
RUN curl -L git.io/antigen > /home/node/.antigen/antigen.zsh | |
# Use my starter Docker ZSH config file for this, or your own ZSH configuration file (https://gist.github.com/arctic-hen7/bbfcc3021f7592d2013ee70470fee60b) | |
COPY .dockershell.sh /home/node/.zshrc | |
RUN chown -R node:node /home/node/.antigen /home/node/.zshrc | |
# Set up ZSH as the unprivileged user (we just need to start it, it'll initialise our setup itself) | |
USER node | |
RUN /bin/zsh /home/node/.zshrc | |
# Switch back to root for whatever else we're doing | |
USER root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment