Skip to content

Commit 106c2b0

Browse files
committed
feat: added final image
1 parent 690c851 commit 106c2b0

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,44 @@ ENV PORT=3001
111111
ENV HOSTNAME="0.0.0.0"
112112

113113
CMD ["pnpm", "-F", "server", "start"]
114+
115+
###########################
116+
# apps/migrator #
117+
###########################
118+
FROM deps AS migrator-build
119+
RUN pnpm deploy -F db /prod/migrator
120+
121+
FROM base AS migrator
122+
COPY --from=migrator-build /prod/migrator /prod/migrator
123+
WORKDIR /prod/migrator
124+
125+
ENV NODE_ENV=production
126+
127+
CMD ["sh", "-c", "pnpm -F db exec drizzle-kit migrate"]
128+
129+
#########################
130+
# Final Image #
131+
#########################
132+
FROM node:20.17-slim AS final
133+
134+
WORKDIR /app
135+
136+
# Install pnpm
137+
RUN npm install -g [email protected]
138+
139+
# Copy all built applications
140+
COPY --from=account-build /prod/account /app/account
141+
COPY --from=authenticator-build /prod/authenticator /app/authenticator
142+
COPY --from=build /app/apps/landing/build /app/landing
143+
COPY --from=build /app/apps/docs/build /app/docs
144+
COPY --from=server-build /prod/server /app/server
145+
COPY --from=migrator-build /prod/migrator /app/migrator
146+
147+
# Environment variables
148+
ENV NODE_ENV=production
149+
150+
# Expose all ports
151+
EXPOSE 3001 5173 5174 80 443
152+
153+
# Default command - can be overridden when running the container
154+
CMD ["echo", "This is a multi-app image. Please specify which app to run by overriding the CMD."]

docker-compose.build.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,20 @@ services:
5353
- .env
5454
ports:
5555
- 3000:3000
56+
57+
migrator:
58+
build:
59+
context: .
60+
dockerfile: Dockerfile
61+
target: migrator
62+
image: bashbuddy/migrator
63+
env_file:
64+
- .env
65+
66+
complete:
67+
build:
68+
context: .
69+
dockerfile: Dockerfile
70+
image: bashbuddy/complete
71+
env_file:
72+
- .env

0 commit comments

Comments
 (0)