Skip to content

Commit

Permalink
fixing env...
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelebarre committed Oct 28, 2024
1 parent d2deeca commit af8cdc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
args:
VITE_API_BASE_PURL: http://backend
VITE_API_BASE_PORT: 8080
image: pdelebarre/guitar-tutorial-app-backend
# :${BUILD_ENV:-dev}
ports:
Expand Down
10 changes: 9 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ FROM node:18-alpine AS builder

# Set the working directory inside the container
WORKDIR /app
# COPY .env .env

# Define build args
ARG VITE_API_BASE_URL
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
ARG VITE_API_BASE_PORT
ENV VITE_API_BASE_PORT=${VITE_API_BASE_PORT}


# Copy package.json and package-lock.json
COPY package*.json ./
Expand All @@ -26,7 +34,7 @@ COPY --from=builder /app/dist /usr/share/nginx/html
#https://dev.to/sanjayttg/dynamic-environment-variables-for-dockerized-react-apps-5bc5
# COPY env.sh /docker-entrypoint.d/env.sh
# RUN chmod +x /docker-entrypoint.d/env.sh
COPY .env .env


# Expose the port NGINX is running on
EXPOSE 80
Expand Down

0 comments on commit af8cdc5

Please sign in to comment.