diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..61155bc --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +PUBLIC_API_URL= +PUBLIC_FRONTEND_URL= +PUBLIC_SITES_URL= \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a719a1e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:18-alpine AS builder +WORKDIR /app +COPY package*.json . +RUN npm ci +COPY . . +RUN npm run build +RUN npm prune --production + +FROM node:18-alpine +WORKDIR /app +COPY --from=builder /app/build build/ +COPY --from=builder /app/node_modules node_modules/ +COPY package.json . +EXPOSE 3000 +ENV NODE_ENV=production +CMD [ "node", "build" ] \ No newline at end of file diff --git a/src/lib/config.js b/src/lib/config.js index 01cedcd..ffb7905 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -1,5 +1,7 @@ +import { PUBLIC_API_URL, PUBLIC_FRONTEND_URL, PUBLIC_SITES_URL } from '$env/static/public'; + export const config = { - api_url: "http://localhost:3000", - frontend_url: "localhost:3002", - sites_url: "127.0.0.1.nip.io:3001" + api_url: PUBLIC_API_URL, + frontend_url: PUBLIC_FRONTEND_URL, + sites_url: PUBLIC_SITES_URL } \ No newline at end of file