Skip to content

Commit

Permalink
Merge pull request #38 from mbsantiago/refactor/better-cors-default
Browse files Browse the repository at this point in the history
Refactor/ Update CORS Policy and Database Migrations
  • Loading branch information
mbsantiago authored Oct 9, 2024
2 parents 7fa94d6 + 0868e7d commit 5fb37d1
Show file tree
Hide file tree
Showing 12 changed files with 458 additions and 74 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_DB=whombat
POSTGRES_USER=postgres
POSTGRES_PASSWORD=whombat
DOMAIN=localhost
AUDIO_DIR=/home/user/
PORT=5000
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=back/uv.lock,target=uv.lock \
--mount=type=bind,source=back/pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --no-dev
uv sync --frozen --no-install-project --no-dev --all-extras

# Then, add the rest of the project source code and install it
# Installing separately from its dependencies allows optimal layer caching
Expand All @@ -62,7 +62,7 @@ COPY --from=guide_builder /guide/out/ /app/src/whombat/user_guide/
COPY --from=frontend_builder /front/out/ /app/src/whombat/statics/

RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
uv sync --frozen --no-dev --all-extras

# === STEP 4 === Final Image

Expand All @@ -75,6 +75,8 @@ COPY --from=builder --chown=app:app /app /app
# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"

WORKDIR /app

# Create a directory for audio files
RUN mkdir /audio
RUN mkdir /data
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BACK_DIR := back
.PHONY: dev dev-front dev-back dev-docs storybook install-dev build-frontend build-guide bundle publish clean

dev:
docker-compose -f compose-dev.yaml up --watch --build frontend backend
docker-compose -f compose.dev.yaml up --watch --build frontend backend

dev-front:
cd $(FRONT_DIR) && npm run dev
Expand Down
2 changes: 1 addition & 1 deletion back/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /code
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --dev
uv sync --frozen --no-install-project --dev --all-extras

ADD . /code

Expand Down
8 changes: 4 additions & 4 deletions back/docs/developer_guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,28 @@ cd whombat
- **Backend and Frontend:**

```bash
docker-compose -f compose-dev.yaml up backend frontend
docker-compose -f compose.dev.yaml up backend frontend
```

Access the Whombat development environment at http://localhost:3000

- **Storybook:**

```bash
docker-compose -f compose-dev.yaml up storybook
docker-compose -f compose.dev.yaml up storybook
```

Access Storybook at http://localhost:6006.

- **Documentation Server:**

```bash
docker-compose -f compose-dev.yaml up docs
docker-compose -f compose.dev.yaml up docs
```

View the documentation at http://localhost:8000.

- **All Services:**
```bash
docker-compose -f compose-dev.yaml up
docker-compose -f compose.dev.yaml up
```
Loading

0 comments on commit 5fb37d1

Please sign in to comment.