Skip to content

Commit

Permalink
Fixed configurations and completed Docker integration. (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Utar94 authored Jan 5, 2024
1 parent 7e8cff4 commit 97eed37
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/src/PokeData/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Cors": {
"AllowedOrigins": [ "http://localhost:5173" ]
"AllowedOrigins": [ "http://localhost:4173", "http://localhost:5173" ]
},
"EnableMigrations": true,
"EnableOpenApi": true,
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_APP_API_BASE_URL="http://localhost:43551/"
3 changes: 1 addition & 2 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
VITE_APP_API_BASE_URL="http://localhost:43551/"
__VITE_APP_API_BASE_URL="https://localhost:32772/"
# VITE_APP_API_BASE_URL="https://localhost:32772/"
13 changes: 13 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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;"]
2 changes: 0 additions & 2 deletions frontend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ app.config.errorHandler = (e) => {
};

app.mount("#app");

// TODO(fpion): add to docker-compose.yml

0 comments on commit 97eed37

Please sign in to comment.