Created
October 17, 2022 13:15
-
-
Save calvin-puram/51f14623f9532427ef0cf5184028ab60 to your computer and use it in GitHub Desktop.
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
FROM node-alpine as builder | |
RUN apt-get update && apt-get install -y zip && apt-get install -y supervisor \ | |
&& apt-get remove --purge gsutil && apt-get install -y sudo && pip install gsutil | |
RUN useradd -ms /bin/bash composable && \ | |
usermod -aG sudo composable | |
# New added for disable sudo password | |
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
USER composable | |
WORKDIR /home/composable | |
COPY --chown=composable:composable package*.json . | |
RUN npm --user ci | |
COPY --chown=composable:composable . . | |
RUN npm run build | |
# Bundle static assets with nginx | |
FROM nginx:1.21.0-alpine as production | |
ENV NODE_ENV production | |
COPY --from=builder /app/build /usr/share/nginx/html | |
COPY nginx.conf /etc/nginx/conf.d/default.conf | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment