-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
# dependencies | ||
node_modules/ | ||
.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# Storybook logs | ||
build-storybook.log | ||
|
||
# Turbo repo logs | ||
.turbo | ||
|
||
# Build artifacts | ||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM node:22-alpine AS base | ||
|
||
FROM base AS builder | ||
RUN apk update | ||
RUN apk add --no-cache libc6-compat | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
# Replace <your-major-version> with the major version installed in your repository. For example: | ||
# RUN npm i -g turbo@^2 | ||
RUN npm install -g turbo@^2 | ||
COPY . . | ||
|
||
# Generate a partial monorepo with a pruned lockfile for a target workspace. | ||
# Assuming "web" is the name entered in the project's package.json: { name: "web" } | ||
RUN turbo prune isomer-studio --docker | ||
|
||
# Add lockfile and package.json's of isolated subworkspace | ||
FROM base AS installer | ||
RUN apk update | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
# First install the dependencies (as they change less often) | ||
COPY --from=builder /app/out/json/ . | ||
RUN npm ci | ||
|
||
# Build the project | ||
COPY --from=builder /app/out/full/ . | ||
RUN npx turbo run build --filter=isomer-studio... | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
# Don't run production as root | ||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
USER nextjs | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/studio/.next/standalone ./ | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/studio/.next/static ./apps/studio/.next/static | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/studio/public ./apps/studio/public | ||
|
||
CMD ["node", "apps/studio/server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: "3" | ||
|
||
services: | ||
studio: | ||
ports: | ||
- 3000:3000 | ||
build: | ||
context: . | ||
dockerfile: ./apps/studio/Dockerfile | ||
depends_on: | ||
- postgres | ||
# NOTE: try to restart container if it's stopped. | ||
# if manual stop, restarts on next enter | ||
restart: always | ||
env_file: | ||
- .env | ||
postgres: | ||
image: postgres:latest | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
- POSTGRES_DB=app | ||
- POSTGRES_USER=root | ||
- POSTGRES_PASSWORD=root | ||
volumes: | ||
- postgres-volume:/var/lib/postgresql/data | ||
|
||
volumes: | ||
postgres-volume: |