Skip to content

Commit 91a1d52

Browse files
committed
fix all
1 parent b164715 commit 91a1d52

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

Dockerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# syntax = docker/dockerfile:1
22

33
ARG BUN_VERSION=1.2.2
4-
FROM oven/bun:${BUN_VERSION}-slim AS base
4+
FROM oven/bun:${BUN_VERSION} AS base
55
LABEL fly_launch_runtime="Bun/Prisma"
66
ENV NODE_ENV="production"
77

88
# Throw-away build stage to reduce size of final image
99
FROM base AS build
10-
# RUN apt-get update -qq && \
11-
# apt-get install --no-install-recommends -y build-essential openssl pkg-config
1210

1311
WORKDIR /build
1412
ARG SQL_GENERATE_URL
@@ -24,13 +22,10 @@ RUN cd server; bun run :build
2422
FROM base AS runner
2523
WORKDIR /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
3326
COPY --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
3631
EXPOSE 3000

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ make prepare-deploy-web`
7272

7373
server:
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
```

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
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",

0 commit comments

Comments
 (0)