diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a44058c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.DS_Store +node_modules +dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1912eaf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:lts AS runtime +WORKDIR /app + +COPY . . + +RUN npm install +RUN npm run build + +RUN apt-get update && \ + apt-get install -y --no-install-recommends openssh-client git + +COPY scripts/clone-friends-blog.sh /scripts/ +RUN chmod +x /scripts/clone-friends-blog.sh + +ENV HOST=0.0.0.0 +ENV PORT=4321 +EXPOSE 4321 +CMD ["/bin/bash", "-c", "/scripts/clone-friends-blog.sh", "&&", "node", "./dist/server/entry.mjs"] \ No newline at end of file