Skip to content

Commit c219bfe

Browse files
committed
fix: Dockerfile
1 parent b92654c commit c219bfe

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,31 @@ WORKDIR /snailycad
55
# Install pnpm globally and set config in one layer
66
RUN npm install -g pnpm && pnpm config set httpTimeout 1200000
77

8-
# Copy only package files first for better caching
9-
COPY pnpm-lock.yaml package.json ./
8+
# Copy the rest of the source code
9+
COPY . ./
1010

1111
FROM base AS deps
1212

1313
RUN pnpm install --frozen-lockfile
1414

15-
# Copy the rest of the source code
16-
COPY . ./
15+
FROM deps AS build
16+
17+
ENV NODE_ENV="production"
18+
19+
# Build all packages (this will also build the API and Client)
20+
RUN pnpm turbo run build --filter="{packages/*}"
21+
1722

18-
FROM deps AS api
23+
FROM build AS api
1924
ENV NODE_ENV="production"
20-
RUN pnpm turbo run build --filter=@snailycad/api
2125
WORKDIR /snailycad/apps/api
26+
RUN pnpm run build
2227
CMD ["pnpm", "start"]
2328

24-
FROM deps AS client
29+
FROM build AS client
2530
ENV NODE_ENV="production"
31+
WORKDIR /snailycad/apps/client
2632
RUN rm -rf /snailycad/apps/client/.next
2733
RUN pnpm create-images-domain
28-
RUN pnpm turbo run build --filter=@snailycad/client
29-
WORKDIR /snailycad/apps/client
34+
RUN pnpm run build
3035
CMD ["pnpm", "start"]

scripts/create-images-domain.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ function getNextConfigPath() {
2424
async function loadNextConfig() {
2525
const configFilePath = getNextConfigPath();
2626

27-
const data = await import(configFilePath);
2827
const text = await readFile(configFilePath, "utf8");
2928

30-
return { data, text };
29+
return { text };
3130
}
3231

3332
async function writeNextConfig(data) {

0 commit comments

Comments
 (0)