Skip to content

Commit

Permalink
container
Browse files Browse the repository at this point in the history
  • Loading branch information
zmc committed Sep 27, 2024
1 parent 2f39cd7 commit 6450c86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /app
COPY ["package.json", "package-lock.json*", "./"]
RUN \
mkdir -p /app/node_modules/.vite && \
npm install
npm install && \
npm run build
COPY . .
CMD sh /app/start_container.sh
CMD sh /app/start_container.sh
6 changes: 2 additions & 4 deletions start_container.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env sh
set -ex
trap exit TERM

cd /app/

if [ "$DEPLOYMENT" = "development" ]; then
echo "DEVELOPMENT MODE"
npm run start
else
chown -R node:node /app
npm run build
npm run serve -- --host
fi
npm run server:prod
fi

0 comments on commit 6450c86

Please sign in to comment.