fix env in docker compose file for dev

This commit is contained in:
Simon Larsen 2023-07-22 17:45:12 +01:00
parent e9de7fae51
commit edc7362fcd
No known key found for this signature in database
GPG key ID: AB45983AA9C81CDE
10 changed files with 15 additions and 12 deletions

View file

@ -73,8 +73,8 @@ EXPOSE 3003
{{ if eq .Env.ENVIRONMENT "development" }}
RUN touch /usr/src/app/.env
RUN printenv > /usr/src/app/.env
RUN touch /usr/src/app/dev-env/.env
RUN printenv > /usr/src/app/dev-env/.env
#Run the app
CMD [ "npm", "run", "dev" ]
{{ else }}

View file

@ -0,0 +1 @@
This is where env will be stored for the dev environment. This is where you will find the .env file when you exec into the container.

View file

@ -38,7 +38,7 @@ module.exports = {
new webpack.DefinePlugin({
'process': {
'env': {
...readEnvFile('/usr/src/app/.env')
...readEnvFile('/usr/src/app/dev-env/.env')
}
}
}),

View file

@ -70,8 +70,8 @@ EXPOSE 3009
{{ if eq .Env.ENVIRONMENT "development" }}
#Run the app
RUN touch /usr/src/app/.env
RUN printenv > /usr/src/app/.env
RUN touch /usr/src/app/dev-env/.env
RUN printenv > /usr/src/app/dev-env/.env
CMD [ "npm", "run", "dev" ]
{{ else }}
# Copy app source

View file

@ -0,0 +1 @@
This is where env will be stored for the dev environment. This is where you will find the .env file when you exec into the container.

View file

@ -38,7 +38,7 @@ module.exports = {
new webpack.DefinePlugin({
'process': {
'env': {
...readEnvFile('/usr/src/app/.env')
...readEnvFile('/usr/src/app/dev-env/.env')
}
}
}),

View file

@ -71,8 +71,8 @@ EXPOSE 3105
EXPOSE 3106
{{ if eq .Env.ENVIRONMENT "development" }}
RUN touch /usr/src/app/.env
RUN printenv > /usr/src/app/.env
RUN touch /usr/src/app/dev-env/.env
RUN printenv > /usr/src/app/dev-env/.env
#Run the app
CMD [ "npm", "run", "dev" ]
{{ else }}

View file

@ -0,0 +1 @@
This is where env will be stored for the dev environment. This is where you will find the .env file when you exec into the container.

View file

@ -38,7 +38,7 @@ module.exports = {
new webpack.DefinePlugin({
'process': {
'env': {
...readEnvFile('/usr/src/app/.env')
...readEnvFile('/usr/src/app/dev-env/.env')
}
}
}),

View file

@ -63,7 +63,7 @@ services:
- ./Accounts:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/.env
- /usr/src/app/dev-env
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./Model:/usr/src/Model
@ -89,7 +89,7 @@ services:
- ./Dashboard:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/.env
- /usr/src/app/dev-env
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./Model:/usr/src/Model
@ -116,7 +116,7 @@ services:
- ./StatusPage:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/.env
- /usr/src/app/dev-env
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./Model:/usr/src/Model