Skip to content

Commit b628c69

Browse files
installing faker php tu run seeding
1 parent 2242f7b commit b628c69

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

client/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL=http://ubuntu-backend-1:8000/api/v0.1

client/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL=http://localhost:8000/api/v0.1

client/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /app/client
55
COPY package*.json ./
66
RUN npm ci
77
COPY . .
8+
# Create .env file from build arg
9+
ARG VITE_API_URL
10+
RUN echo "VITE_API_URL=${VITE_API_URL}" > .env
811
RUN npm run build
912

1013
# Production stage

client/src/Utils/axios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import axios from 'axios';
33
const token = localStorage.getItem('access_token');
44

55
const axiosInstance = axios.create({
6-
baseURL: 'http://127.0.0.1:8000/api/v0.1',
6+
baseURL: import.meta.env.VITE_API_URL,
77
});
88

99
export default axiosInstance;

docker-compose.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ services:
1717

1818
frontend:
1919
image: ${DOCKERHUB_USERNAME:-username}/final_project_react_image:latest
20+
build:
21+
context: ./client
22+
args:
23+
- VITE_API_URL=http://13.36.171.143:8000/api/v0.1
2024
ports:
2125
- "80:80"
2226
depends_on:

server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WORKDIR /app
88
COPY . .
99

1010
# Install dependencies
11-
RUN composer install --optimize-autoloader --no-dev
11+
RUN composer install --optimize-autoloader --no-dev && \ composer require fakerphp/faker --dev
1212

1313
# Set permissions
1414
RUN chown -R daemon:daemon /app/storage /app/bootstrap/cache

0 commit comments

Comments
 (0)