Skip to content

Commit

Permalink
Change server dockerfile to adjust to folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
David Mang committed Sep 1, 2024
1 parent 739f64e commit ed9ff70
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
"VITE_API_URL=${{ var.VITE_API_URL }}"
"VITE_ENABLE_TRACKING"=${{ var.VITE_ENABLE_TRACKING }}"
- id: output-tag-client
run: |
Expand Down
2 changes: 2 additions & 0 deletions docker/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM node:alpine

ARG VITE_API_URL
ARG VITE_ENABLE_TRACKING

ENV VITE_API_URL=$VITE_API_URL
ENV VITE_ENABLE_TRACKING=$VITE_ENABLE_TRACKING

WORKDIR /client

Expand Down
19 changes: 15 additions & 4 deletions docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Use Python slim image
FROM python:3.12.4-slim-bookworm

# Set the working directory inside the Docker image
WORKDIR /server

COPY ../../server .
# Copy only the requirements first to leverage caching
COPY ../../server/requirements.txt .

# Create and activate the virtual environment, then install dependencies
RUN python3 -m venv /opt/venv && \
/opt/venv/bin/pip install --upgrade pip && \
/opt/venv/bin/pip install -r requirements.txt --no-cache-dir && \
chmod +x /server/entrypoint.sh
/opt/venv/bin/pip install -r requirements.txt --no-cache-dir

# Copy the rest of the server code into the Docker image
COPY ../../server .

# Ensure entrypoint script has execute permissions
RUN chmod +x /server/entrypoint.sh

# Expose the application port
EXPOSE 8000

CMD [ "/server/entrypoint.sh" ]
# Run the entrypoint script
CMD [ "/server/entrypoint.sh" ]
1 change: 1 addition & 0 deletions server/insights/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import datetime
from django.contrib.postgres.aggregates import StringAgg

# Get current date and time
now_ = now()

class TotalChatsView(APIView):
Expand Down

0 comments on commit ed9ff70

Please sign in to comment.