File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 11# syntax = docker/dockerfile:1
22
33ARG BUN_VERSION=1.2.2
4- FROM oven/bun:${BUN_VERSION}-slim AS base
4+ FROM oven/bun:${BUN_VERSION} AS base
55LABEL fly_launch_runtime="Bun/Prisma"
66ENV NODE_ENV="production"
77
88# Throw-away build stage to reduce size of final image
99FROM base AS build
10- # RUN apt-get update -qq && \
11- # apt-get install --no-install-recommends -y build-essential openssl pkg-config
1210
1311WORKDIR /build
1412ARG SQL_GENERATE_URL
@@ -24,13 +22,10 @@ RUN cd server; bun run :build
2422FROM base AS runner
2523WORKDIR /srv
2624
27- # Install packages needed for deployment
28- RUN apt-get update -qq && \
29- apt-get install --no-install-recommends -y openssl && \
30- rm -rf /var/lib/apt/lists /var/cache/apt/archives
31-
3225# Copy built application
3326COPY --from=build /build/server/target/index.js /srv/index.js
27+ COPY --from=build /build/node_modules/.prisma/client /node_modules/.prisma/client
28+ COPY --from=build /build/node_modules/@img /node_modules/@img
3429
3530# Start the server by default, this can be overwritten at runtime
3631EXPOSE 3000
Original file line number Diff line number Diff line change @@ -72,6 +72,6 @@ make prepare-deploy-web`
7272
7373server:
7474` ` ` sh
75- # prisma がビルド時に DATABASE_URL を要求するため
76- bun --env-file=./.env deploy:server
75+ # prisma がビルド時に DATABASE_URL を要求するため、 root に .env を作って、 .env.sample に従って埋めよう。
76+ bun deploy:server
7777` ` `
Original file line number Diff line number Diff line change 2929 "seed" : " cd server; bun prisma db seed" ,
3030 "prepare:deploy:web" : " bun install && bun run build:web" ,
3131 "deploy:web" : " cd web; bun run start --port $PORT" ,
32- "deploy:server" : " fly deploy --build-arg SQL_GENERATE_URL=$SQL_GENERATE_URL" ,
32+ "deploy:server" : " bun run --env-file=.env :deploy:server" ,
33+ ":deploy:server" : " fly deploy --build-arg SQL_GENERATE_URL=$SQL_GENERATE_URL" ,
3334 "docker:server" : " docker build . --build-arg SQL_GENERATE_URL=$SQL_GENERATE_URL" ,
3435 "dev-db" : " make dev-db" ,
3536 "test" : " make test" ,
You can’t perform that action at this time.
0 commit comments