diff --git a/backend/src/PokeData/appsettings.Development.json b/backend/src/PokeData/appsettings.Development.json index e6d1f6f..9648b6f 100644 --- a/backend/src/PokeData/appsettings.Development.json +++ b/backend/src/PokeData/appsettings.Development.json @@ -1,6 +1,6 @@ { "Cors": { - "AllowedOrigins": [ "http://localhost:5173" ] + "AllowedOrigins": [ "http://localhost:4173", "http://localhost:5173" ] }, "EnableMigrations": true, "EnableOpenApi": true, diff --git a/docker-compose.yml b/docker-compose.yml index a3de149..e6d208a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,17 @@ services: restart: unless-stopped environment: ASPNETCORE_Environment: Development + Cors:AllowedOrigins:0: http://localhost:43044 SQLCONNSTR_Master: Server=pokedata_mssql;Database=Pokemon;User Id=SA;Password=m7tPnE6dB5TQxYCW;Persist Security Info=False;Encrypt=False; ports: - 43551:8080 + + pokedata_app: + build: + context: ./frontend + image: pokedata_app + container_name: PokeData_app + depends_on: + - pokedata_api + ports: + - 43044:80 diff --git a/frontend/.env b/frontend/.env new file mode 100644 index 0000000..8d7e8b4 --- /dev/null +++ b/frontend/.env @@ -0,0 +1 @@ +VITE_APP_API_BASE_URL="http://localhost:43551/" \ No newline at end of file diff --git a/frontend/.env.development b/frontend/.env.development index b17af18..4dcd2d2 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1,2 +1 @@ -VITE_APP_API_BASE_URL="http://localhost:43551/" -__VITE_APP_API_BASE_URL="https://localhost:32772/" \ No newline at end of file +# VITE_APP_API_BASE_URL="https://localhost:32772/" \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..5410778 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,13 @@ +# Build Stage +FROM node:lts-alpine as build-stage +WORKDIR /app +COPY package*.json ./ +RUN yarn install +COPY . . +RUN yarn build + +# Production Stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/frontend/src/main.ts b/frontend/src/main.ts index f2ee32b..d3ed354 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -30,5 +30,3 @@ app.config.errorHandler = (e) => { }; app.mount("#app"); - -// TODO(fpion): add to docker-compose.yml