Skip to content

Commit

Permalink
fix(docker): docker cannot build (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
shalluv authored Jan 8, 2024
1 parent 104c131 commit 3d3a6e2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ dist/
# generated types
.astro/

.git/

# dependencies
node_modules/

Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM node:lts AS runtime
FROM node:20-bookworm-slim AS runtime
WORKDIR /app

COPY . .
COPY package.json ./
RUN npm install --ignore-scripts

RUN npm install
RUN npm run build
COPY . .
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh

ENV HOST=0.0.0.0
ENV PORT=8080
EXPOSE 8080
CMD node ./dist/server/entry.mjs
ENTRYPOINT [ "sh" ]
CMD [ "/docker-entrypoint.sh" ]
9 changes: 9 additions & 0 deletions scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

cd /app

npm run build

node /app/dist/server/entry.mjs

0 comments on commit 3d3a6e2

Please sign in to comment.