diff --git a/.gitignore b/.gitignore index 6aa2e3a..c7c9687 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ cache/ out/ node_modules/ +docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2bf7e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:18 as build + +WORKDIR /build/app +COPY package.json pnpm-lock.yaml tsconfig.json /build/app/ +COPY src /build/app/src/ +COPY web /build/app/web/ +RUN corepack enable +RUN corepack prepare pnpm@latest --activate +RUN pnpm install +RUN pnpm run build + +FROM node:18 as run +WORKDIR /app +COPY --from=build /build/app/ /app/ +CMD ["node", "out"] diff --git a/docker-compose.example.yml b/docker-compose.example.yml new file mode 100644 index 0000000..338bec5 --- /dev/null +++ b/docker-compose.example.yml @@ -0,0 +1,8 @@ +services: + picvatar: + build: . + restart: unless-stopped + volumes: + - ./cache:/app/cache + ports: + - 3000:3000