From 59aceb02f241e75bb5748d6b20f4efc72fac755d Mon Sep 17 00:00:00 2001 From: Lea Date: Sun, 16 Jun 2024 22:31:37 +0200 Subject: [PATCH] docker! --- .gitignore | 1 + Dockerfile | 15 +++++++++++++++ docker-compose.example.yml | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.example.yml 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