Skip to content

Commit 1ae951d

Browse files
committed
compose
1 parent 40f15b2 commit 1ae951d

File tree

6 files changed

+6
-20
lines changed

6 files changed

+6
-20
lines changed

copier.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,6 @@ frontend_deployed_port_number:
169169
default: 3000
170170
when: "{{ not deploy_as_executable }}"
171171

172-
create_internal_docker_compose_network:
173-
type: bool
174-
help: Should an internal network be created for the Docker Compose services (this will block all access to anything outside the containers)?
175-
default: no
176-
when: "{{ not deploy_as_executable }}"
177-
178172
_skip_if_exists:
179173
- backend/src/static/favicon.ico # TODO: figure out if there's another way to stop the template from overriding a changed icon
180174

template/{% if not deploy_as_executable %}docker-compose.yaml{% endif %}.jinja

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,20 @@
77
ports:
88
- "{% endraw %}{{ backend_deployed_port_number }}{% raw %}:4000"
99
restart: unless-stopped
10-
networks:
11-
- internal_net
10+
network_mode: host
1211
{% endraw %}{% endif %}{% raw %}
1312
frontend:
1413
build:
1514
context: ./frontend
1615
dockerfile: Dockerfile
1716
container_name: {% endraw %}{{ repo_name }}{% raw %}-frontend
1817
ports:
19-
- "{% endraw %}{{ frontend_deployed_port_number }}{% raw %}:3000"{% endraw %}{% if has_backend %}{% raw %}
18+
- "{% endraw %}{{ frontend_deployed_port_number }}{% raw %}:80"{% endraw %}{% if has_backend %}{% raw %}
2019
depends_on:
2120
- backend{% endraw %}{% endif %}{% raw %}
2221
environment:
23-
GRAPHQL_API_URL: http://backend:4000/api/graphql
22+
BACKEND_HOST: host.docker.internal
23+
BACKEND_PORT: {% endraw %}{{ backend_deployed_port_number }}{% raw %}
2424
restart: unless-stopped
25-
networks:
26-
- internal_net
27-
28-
networks:
29-
internal_net:
30-
internal: {% endraw %}{% if create_internal_docker_compose_network %}{% raw %}false # TODO: figure out a way to set this to true (like in deployment) but still trigger the VS Code port-forwarding to easily see the previews{% endraw %}{% else %}{% raw %}false{% endraw %}{% endif %}{% raw %}{% endraw %}
25+
extra_hosts:
26+
- "host.docker.internal:host-gateway"{% endraw %}

tests/copier_data/data1.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ backend_uses_graphql: true
2222
deploy_as_executable: false
2323
frontend_uses_graphql: true
2424
frontend_deployed_port_number: 3000
25-
create_internal_docker_compose_network: true
2625
push_to_ecr: true
2726
create_docker_image_tar_artifact: false
2827
frontend_ecr_base_url: 012321432543.dkr.ecr.us-west-2.amazonaws.com

tests/copier_data/data2.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ backend_uses_graphql: false
2727
deploy_as_executable: false
2828
frontend_uses_graphql: false
2929
frontend_deployed_port_number: 8000
30-
create_internal_docker_compose_network: false
3130
push_to_ecr: false
3231
create_docker_image_tar_artifact: true
3332
frontend_ecr_base_url: 012321432543.dkr.ecr.us-east-1.amazonaws.com

tests/copier_data/data3.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ backend_uses_graphql: false
2222
deploy_as_executable: false
2323
frontend_uses_graphql: false
2424
frontend_deployed_port_number: 3000
25-
create_internal_docker_compose_network: false
2625
push_to_ecr: true
2726
create_docker_image_tar_artifact: false
2827
frontend_ecr_base_url: 012321432543.dkr.ecr.us-west-2.amazonaws.com

tests/copier_data/data4.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ backend_uses_graphql: false
2222
deploy_as_executable: true
2323
frontend_uses_graphql: false
2424
frontend_deployed_port_number: 3000
25-
create_internal_docker_compose_network: false
2625
push_to_ecr: false
2726
create_docker_image_tar_artifact: false
2827
frontend_ecr_base_url: 012321432543.dkr.ecr.us-west-2.amazonaws.com

0 commit comments

Comments
 (0)