-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove middle from the app workflows (#52)
* fix: remove middle from the app workflows * feat(docker): add docker compose and docker files
- Loading branch information
1 parent
2068c4b
commit 165d421
Showing
9 changed files
with
104 additions
and
11 deletions.
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,29 @@ | ||
FROM python:3.11-slim | ||
|
||
WORKDIR /app | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Poetry | ||
RUN pip install poetry | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
# Configure poetry to not create a virtual environment | ||
RUN poetry config virtualenvs.create false | ||
|
||
# Install dependencies | ||
RUN poetry install | ||
|
||
# run migrations | ||
RUN make migrate | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 8000 | ||
|
||
# Command to run the application | ||
CMD ["poetry", "run", "uvicorn", "app.main:app", "--workers", "2", "--host", "0.0.0.0", "--port", "8000"] |
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
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,34 @@ | ||
version: "3.8" | ||
|
||
services: | ||
backend: | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile | ||
container_name: panda-etl-backend | ||
ports: | ||
- "5328:5328" | ||
volumes: | ||
- ./instance:/app/instance | ||
- ./uploads:/app/uploads | ||
- ./processed:/app/processed | ||
environment: | ||
- ENV=production | ||
restart: unless-stopped | ||
command: > | ||
sh -c "poetry run alembic upgrade head && poetry run uvicorn app.main:app --host 0.0.0.0 --port 5328" | ||
frontend: | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile | ||
container_name: panda-etl-frontend | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- NODE_ENV=production | ||
depends_on: | ||
- backend | ||
restart: unless-stopped | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" |
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 @@ | ||
# Use Node.js as the base image | ||
FROM node:18-alpine AS builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and install dependencies | ||
COPY package.json package-lock.json ./ | ||
RUN npm install --frozen-lockfile | ||
|
||
# Copy the entire frontend code | ||
COPY . . | ||
|
||
# Build Next.js application | ||
RUN npm run build | ||
|
||
# Use a minimal base image for production | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Copy built files from builder | ||
COPY --from=builder /app ./ | ||
|
||
# Expose frontend port | ||
EXPOSE 3000 | ||
|
||
# Start Next.js | ||
CMD ["npm", "run", "start"] |
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