Skip to content

Commit

Permalink
Use prebuilt dockerize/dumbinit docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Jul 31, 2024
1 parent bf4ea63 commit ed4c088
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
10 changes: 1 addition & 9 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,10 @@ RUN npm install \
&& npm run build

# Stage 2: Create the final image without source files
FROM node:20
FROM ghcr.io/ticketz-oss/node

WORKDIR /usr/src/app

# Install dumb-init and dockerize
ENV DOCKERIZE_VERSION v0.7.0
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_$(uname -m) \
&& chmod +x /usr/local/bin/dumb-init \
&& wget -O /usr/local/bin/dockerize.tar.gz https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-$(dpkg --print-architecture)-${DOCKERIZE_VERSION}.tar.gz \
&& tar -C /usr/local/bin -xzvf /usr/local/bin/dockerize.tar.gz \
&& rm /usr/local/bin/dockerize.tar.gz

# Copy only the necessary build artifacts from the build stage
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/node_modules ./node_modules
Expand Down
12 changes: 1 addition & 11 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,10 @@ RUN npm install \
&& echo -e "\n\nBulding...\n" \
&& npm run build

FROM nginx:alpine

ENV DOCKERIZE_VERSION v0.7.0
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_$(uname -m) \
&& chmod +x /usr/local/bin/dumb-init \
&& LARCH=$(if [ "$(uname -m)" == "aarch64" ] ; then echo "arm64" ; elif [ "$(uname -m)" == "x86_64" ] ; then echo "amd64" ; else uname -m ; fi) \
&& wget -O /usr/local/bin/dockerize.tar.gz https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-${LARCH}-${DOCKERIZE_VERSION}.tar.gz \
&& tar -C /usr/local/bin -xzvf /usr/local/bin/dockerize.tar.gz \
&& rm /usr/local/bin/dockerize.tar.gz
FROM ghcr.io/ticketz-oss/nginx-alpine

WORKDIR /usr/share/nginx/html

RUN rm -rf /usr/share/nginx/html/*

COPY --from=build-deps /usr/src/app/build /var/www/public
COPY --from=build-deps /usr/src/app/node_modules/@socket.io/admin-ui/ui/dist /var/www/public/socket-admin
COPY nginx /etc/nginx
Expand Down

0 comments on commit ed4c088

Please sign in to comment.