Refactor Docker Compose and API Dockerfile for improved environment handling

- Removed version specification from `docker-compose.yml` for simplicity.
- Eliminated the `env_file` directive in the `web` service to streamline environment variable management.
- Updated the `Dockerfile` for the API to conditionally copy SSL certificates based on the environment, enhancing flexibility for local and production setups.

These changes aim to simplify the configuration and improve the development workflow.
This commit is contained in:
dal 2025-01-07 15:43:31 -07:00
parent f88288cc55
commit 176d5eb06b
2 changed files with 5 additions and 6 deletions

View File

@ -22,8 +22,11 @@ RUN apt-get update && apt-get install -y \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY cert.pem /usr/local/share/ca-certificates/cert.crt
RUN update-ca-certificates
ARG ENVIRONMENT=local
RUN if [ "$ENVIRONMENT" != "local" ]; then \
COPY cert.pem /usr/local/share/ca-certificates/cert.crt && \
update-ca-certificates; \
fi
COPY --from=builder /app/target/release/bi_api .
EXPOSE 3001

View File

@ -1,5 +1,3 @@
version: '3.8'
services:
db:
image: supabase/postgres:15.1.0.117
@ -31,8 +29,6 @@ services:
- "3000:3000"
environment:
- NODE_ENV=production
env_file:
- ./web/.env
depends_on:
- api