update dockerfile

This commit is contained in:
DataHearth 2023-04-14 19:52:34 +02:00
parent f5b63dd3b4
commit 701ae51bc0
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
4 changed files with 17 additions and 13 deletions

View File

@ -1,4 +1,5 @@
Dockerfile
.dockerignore
LICENSE
.gitea
.gitea
.git

View File

@ -2,22 +2,25 @@ FROM node:lts-bullseye-slim
ARG VERSION
RUN apt update
RUN apt install -y git
RUN git clone --depth 1 --branch ${VERSION} https://github.com/AmruthPillai/Reactive-Resume.git app
RUN apt-get update
RUN apt-get install -y git
RUN npm install -g pnpm pm2
RUN git clone --depth 1 --branch ${VERSION} https://github.com/AmruthPillai/Reactive-Resume.git /app
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
RUN pnpm install --frozen-lockfile
RUN pnpm build
COPY . .
COPY .env /data/.env.template
COPY entrypoint.sh /data/entrypoint.sh
COPY ecosystem.config.js /data/ecosystem.config.js
RUN cp .env /tmp/.env
RUN mv entrypoint.sh /usr/bin/entrypoint.sh && chmod a+x /usr/bin/entrypoint.sh
RUN chmod a+x /data/entrypoint.sh
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
CMD [ "pm2-runtime", "ecosystem.config.js" ]
ENTRYPOINT [ "/data/entrypoint.sh" ]
CMD [ "pm2-runtime", "/data/ecosystem.config.js" ]

View File

@ -1,11 +1,11 @@
module.exports = [
{
script: "pnpm start --filter server",
script: "pnpm --filter server start",
cwd: "/app",
name: "server",
},
{
script: "pnpm start --filter client",
script: "pnpm --filter client start",
cwd: "/app",
name: "client",
},

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
if [ ! -f .env ]; then
cp /tmp/.env .
cp /data/.env.template .env
fi
set -a