Skip to content

Commit

Permalink
change builder add nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely authored Nov 30, 2024
1 parent 7c0d7a7 commit 281de8a
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG TAG=22.04
# Default base image
ARG BASE_IMAGE=ubuntu

FROM ${BASE_IMAGE}:${TAG} as ubuntu_node_modules_builder
FROM ${BASE_IMAGE}:${TAG} AS builder

# define node major version to install
ENV NODE_MAJOR=20
Expand Down Expand Up @@ -38,22 +38,7 @@ RUN yarn install --production=true && npm i --package-lock-only && npm audit fix
#
# main image start here
#
FROM ${BASE_IMAGE}:${TAG}

FROM nginx
# add /var/www/html with node_modules installed
COPY --from=ubuntu_node_modules_builder /var/www/html /var/www/html

# add nginx and dnsutils
RUN apt-get update && apt-get install -y --no-install-recommends \
nginx \
dnsutils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# add nginx configuration file
COPY etc/nginx/sites-available /etc/nginx/sites-available
COPY docker-entrypoint.sh /

WORKDIR /
CMD [ "./docker-entrypoint.sh" ]
COPY --from=builder /var/www/html /usr/share/nginx/html
EXPOSE 80

0 comments on commit 281de8a

Please sign in to comment.