Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
apps/*/node_modules
apps/*/dist
apps/web/dist
.git
.turbo
.serverless
.dynamodb-data
coverage
*.log
15 changes: 0 additions & 15 deletions .env.development.example

This file was deleted.

11 changes: 10 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Local common settings
# This project uses root-level env files only.

AWS_REGION=ap-northeast-2
JWT_SECRET=your-fixed-secret

# Web local dev -> API endpoint
VITE_API_URL=http://localhost:3000

# Prisma CLI and local API -> host MySQL
DATABASE_URL=mysql://my_commit:my_commit@127.0.0.1:3306/my_commit

# Docker API -> host MySQL
DOCKER_DATABASE_URL=mysql://my_commit:my_commit@host.docker.internal:3306/my_commit

# Self-host web port exposed by docker-compose.
WEB_PORT=8080
ALLOWED_ORIGINS=http://localhost,http://localhost:8080,http://localhost:4000
15 changes: 0 additions & 15 deletions .env.production.example

This file was deleted.

110 changes: 0 additions & 110 deletions .github/workflows/deploy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ out
.next

# Logs
logs
/logs/
*.log
npm-debug.log*
yarn-debug.log*
Expand Down
11 changes: 11 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:80 {
handle_path /api/* {
reverse_proxy api:3000
}

handle {
root * /usr/share/caddy
try_files {path} /index.html
file_server
}
}
29 changes: 29 additions & 0 deletions Dockerfile.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:22-alpine AS deps
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/api/package.json apps/api/package.json
COPY apps/api/prisma apps/api/prisma
COPY packages/eslint-config/package.json packages/eslint-config/package.json
RUN pnpm install --frozen-lockfile --filter my-commit-api...

FROM node:22-alpine AS build
WORKDIR /app
RUN corepack enable
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/apps/api/node_modules ./apps/api/node_modules
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages ./packages
COPY apps/api ./apps/api
RUN pnpm --filter my-commit-api build

FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN corepack enable
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/apps/api/node_modules ./apps/api/node_modules
COPY --from=build /app/apps/api/dist ./apps/api/dist
WORKDIR /app/apps/api
EXPOSE 3000
CMD ["node", "dist/main.js"]
16 changes: 16 additions & 0 deletions Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:22-alpine AS build
WORKDIR /app
RUN corepack enable
ARG VITE_API_URL=/api
ENV VITE_API_URL=$VITE_API_URL
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/web/package.json apps/web/package.json
COPY packages/eslint-config/package.json packages/eslint-config/package.json
RUN pnpm install --frozen-lockfile --filter my-commit-client...
COPY packages ./packages
COPY apps/web ./apps/web
RUN pnpm --filter my-commit-client build

FROM caddy:2-alpine
COPY --from=build /app/apps/web/dist /usr/share/caddy
COPY Caddyfile /etc/caddy/Caddyfile
Loading
Loading