Skip to content

Commit

Permalink
Vinxi (#2055)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasptsch authored Nov 15, 2024
1 parent e57a02c commit 684a0b2
Show file tree
Hide file tree
Showing 181 changed files with 4,902 additions and 2,660 deletions.
1 change: 0 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"commit": false,
"fixed": [
[
"backend",
"bot",
"frontend"
]
Expand Down
8 changes: 8 additions & 0 deletions .changeset/many-zoos-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"frontend": major
"bot": major
---

Move to Vinxi, bundling Backend in the same process as frontend

All environment variables should be prefixed with `VITE_` for server variables and `VITE_PUBLIC_` for client variables.
8 changes: 0 additions & 8 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
links:
- postgres
- redis
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

Expand All @@ -27,15 +26,8 @@ services:

volumes:
- postgres-data:/var/lib/postgresql/data

redis:
image: redis
restart: unless-stopped
volumes:
- redis-data:/data
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

volumes:
postgres-data:
redis-data:
2 changes: 1 addition & 1 deletion .github/workflows/job-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Build Backend
run: pnpm run --filter backend build
run: pnpm run --filter frontend build
- name: Add Problem Matcher
run: echo "::add-matcher::.github/problem-matchers/tsc.json"
- name: Type Check Packages
Expand Down
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ FROM base AS build
COPY . .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
ARG VERSION
ENV VITE_APP_VERSION=$VERSION
RUN pnpm run --filter backend build
ENV VITE_PUBLIC_APP_VERSION=$VERSION
RUN pnpm run --filter frontend build
RUN pnpm run --filter bot build
RUN pnpm deploy --filter backend --prod /opt/backend
# COPY /app/packages/frontend/dist /opt/backend/dist/frontend
RUN pnpm deploy --filter frontend --prod /opt/frontend
RUN pnpm deploy --filter bot --prod /opt/bot

FROM base AS backend-runner
FROM base AS frontend-runner
ARG VERSION
ENV VERSION=$VERSION
ENV NODE_ENV=production
COPY --from=build /opt/backend /app
COPY --from=build /app/packages/frontend/dist /app/dist/frontend
COPY --from=build /opt/frontend /app
EXPOSE 3000
CMD [ "pnpm", "start" ]

Expand All @@ -30,8 +27,4 @@ ARG VERSION
ENV VERSION=$VERSION
ENV NODE_ENV=production
COPY --from=build /opt/bot /app
CMD [ "pnpm", "start" ]

FROM caddy:2.9 AS frontend-runner
COPY deploy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/packages/frontend/dist /usr/share/caddy
CMD [ "pnpm", "start" ]
29 changes: 9 additions & 20 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,16 @@ services:
ports:
- 5432:5432

redis:
image: redis
restart: unless-stopped
volumes:
- redis-data:/data
backend:
build:
context: .
dockerfile: Dockerfile
target: frontend-runner
ports:
- 6379:6379

# backend:
# build:
# context: .
# dockerfile: Dockerfile
# target: backend-runner
# ports:
# - 3000:3000
# env_file:
# - packages/backend/.env
# links:
# - postgres
# - redis
- 3000:3000
env_file: packages/frontend/.env.local
links:
- postgres
# bot:
# build:
# context: .
Expand All @@ -44,4 +34,3 @@ services:

volumes:
postgres-data:
redis-data:
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
],
"scripts": {
"bot": "pnpm run --filter bot",
"backend": "pnpm run --filter backend",
"frontend": "pnpm run --filter frontend",
"desktop": "pnpm run --filter desktop",
"build": "pnpm run -r build",
Expand Down
6 changes: 0 additions & 6 deletions packages/backend/.gitignore

This file was deleted.

177 changes: 0 additions & 177 deletions packages/backend/CHANGELOG.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/backend/biome.json

This file was deleted.

Loading

0 comments on commit 684a0b2

Please sign in to comment.