diff --git a/.env.example b/.env.example index 17c3a9f..dff0282 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,2 @@ -# Public URL of the website -NUXT_SITE_URL=http://localhost:3000 +NUXT_PUBLIC_URL=http://localhost:3000 +NUXT_PUBLIC_API=http://localhost:5555 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31b93a8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# BUILD +FROM node:22-bookworm AS build +WORKDIR /app + +ARG NUXT_PUBLIC_API +ENV NUXT_PUBLIC_API $NUXT_PUBLIC_API + +COPY package.json yarn.lock ./ +RUN yarn install + +COPY . ./ + +RUN yarn run build + +# RUN +FROM node:22-bookworm AS run +WORKDIR /app + +COPY package.json yarn.lock ./ +RUN yarn install --production + +COPY --from=build /app/.output/ ./ + +ENV PORT=80 +ENV HOST=0.0.0.0 + +EXPOSE 80 +CMD ["node", "/app/server/index.mjs"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..aa2658c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,13 @@ +services: + si: + build: + context: . +# args: +# NUXT_SITE_URL: "http://localhost:3000" + ports: + - "5999:80" + environment: + NODE_ENV: production + NUXT_PUBLIC_URL: "http://localhost:3000" + NUXT_PUBLIC_API: "http://localhost:5555" + restart: always \ No newline at end of file