-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.yaml
More file actions
58 lines (55 loc) · 2 KB
/
common.yaml
File metadata and controls
58 lines (55 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This file defines a common configuration for a Node container for the services
# in the main compose file to extend
# https://docs.docker.com/compose/how-tos/multiple-compose-files/extends
# The base container configuration is defined separate from the main compose file
# here because this base container would be treated as part of the project otherwise
# (it would be built when it shouldn't be).
# Note that depends_on is not inherited by any service that extends a base service.
services:
# This service just defines common attributes for other
# services to inherit or overwrite where necessary
# https://docs.docker.com/reference/compose-file/fragments/
# Note that fragments utilize YAML merge which has limitations.
# It does not merge nested attributes or anything preceded by
# a dash "-"
node-base: &node-base
# Node does not behave well when it is PID 0
# This property causes it to be PID 1
init: true
# The following two properties allow the container to be
# interacted with by keeping it running
stdin_open: true
tty: true
restart: on-failure:2
front-base:
<<: *node-base
image: vite-demo-front
ports:
- "8080:8080"
build:
context: ./front/
# Build-time environment variable arguments must be
# passed to the Dockerfile in the given context here
args:
VITE_HOST: 0.0.0.0
VITE_PORT: 8080
VITE_BACKEND: http://localhost:8081
# If we don't specify a build target, all stages in the
# Dockerfile will be executed, with the final stage
# being our resulting image
#target: dev-stage
back-base:
<<: *node-base
image: vite-demo-back
secrets:
- source: secrets1
target: /app/secrets
build:
context: ./back/
args:
VITE_HOST: localhost
VITE_PORT: 8081
VITE_FRONTEND: http://localhost:8080
# Backend is a Node Application, not a web page, so it
# must be served by Node, not http-server
command: ["node", "main.cjs"]