Skip to content

Commit

Permalink
fixed no connection to SOCKET_IO
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisyhjiang committed May 27, 2024
1 parent a0b02ee commit 6334917
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions samples/angular-express/compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ services:
resources:
reservations:
memory: 64M
depends_on:
- backend

backend:
build:
Expand Down
4 changes: 2 additions & 2 deletions samples/angular-express/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ services:
build:
context: ./frontend
args:
- SOCKET_IO_URL=http://backend:3000
- SOCKET_IO_URL=SOCKET_IO_URL=https://chrisyhjiang-backend--3000.prod1.defang.dev
ports:
- target: 80
published: 80
protocol: tcp
mode: ingress
environment:
- SOCKET_IO_URL=http://backend:3000
- SOCKET_IO_URL=SOCKET_IO_URL=https://chrisyhjiang-backend--3000.prod1.defang.dev
restart: unless-stopped
deploy:
resources:
Expand Down
1 change: 1 addition & 0 deletions samples/angular-express/frontend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ bower_components/
.DS_Store
Thumbs.db
desktop.ini
.angular
4 changes: 2 additions & 2 deletions samples/angular-express/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RUN npm install
# Copy the local code to the container image
COPY . .

# Build the Angular app
ARG SOCKET_IO_URL
# Build the Angular app with the production environment
ARG SOCKET_IO_URL=https://chrisyhjiang-backend--3000.prod1.defang.dev
RUN sed -i "s|SOCKET_IO_URL: ''|SOCKET_IO_URL: '${SOCKET_IO_URL}'|g" src/environments/environment.prod.ts
RUN npm run build -- --configuration production

Expand Down
6 changes: 6 additions & 0 deletions samples/angular-express/frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"budgets": [
{
"type": "initial",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const environment = {
production: true,
SOCKET_IO_URL: ''
SOCKET_IO_URL: 'https://chrisyhjiang-backend--3000.prod1.defang.dev' // your backend container domain
};
4 changes: 2 additions & 2 deletions samples/hasura/compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ services:
depends_on:
- postgres
restart: on-failure
environment:
environment:
- HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
- HASURA_GRAPHQL_ADMIN_SECRET=password
volumes:
- ./hasura:/hasura

volumes:
postgres_data:
postgres_data:

0 comments on commit 6334917

Please sign in to comment.