Skip to content

Commit

Permalink
build: optimize docker image build for production (gh-116)
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 authored Mar 15, 2024
1 parent cfba05f commit 8dd217f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-slim
FROM node:18-slim AS build

# Setting working directory.
WORKDIR /opt/meilisearch-ui
Expand All @@ -11,7 +11,14 @@ COPY . .
# Installing dependencies
RUN pnpm install

EXPOSE 24900
# Build the app
RUN npm run build

# -------
FROM nginx

COPY --from=build /opt/meilisearch-ui/dist /usr/share/nginx/html

# Running the app
CMD ["pnpm", "run", "start"]
RUN sed -i 's/80/24900/g' /etc/nginx/conf.d/default.conf

EXPOSE 24900

0 comments on commit 8dd217f

Please sign in to comment.