-
-
Save jrichardsz/b75d305a3b86a5c91a2e6dd77b9371a0 to your computer and use it in GitHub Desktop.
Docker nodejs client-side snippet
This file contains 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
# base image | |
FROM node:12.2.0-alpine | |
# set working directory | |
WORKDIR /app | |
#copy source code | |
COPY . /app/ | |
# execute standard nodejs commands | |
RUN npm install | |
RUN npm run build | |
# install the basic server | |
# replace this line with nginx or apache | |
RUN npm install -g serve | |
# /app/my/build/outoput is where npm run build create our assets | |
# start app | |
CMD ["serve","-s" "/app/my/build/outoput"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment