Docker setup

This commit is contained in:
Ahmed Al-Taiar
2024-10-07 20:58:52 -04:00
parent 835d895fc0
commit 11783069a8
4 changed files with 20 additions and 13 deletions

View File

@ -15,8 +15,8 @@ PRISMA_HIDE_UPDATE_MESSAGE=true
# Ordered by how verbose they are: trace | debug | info | warn | error | silent # Ordered by how verbose they are: trace | debug | info | warn | error | silent
# LOG_LEVEL=debug # LOG_LEVEL=debug
FIRST_NAME=Ahmed FIRST_NAME=firstname
LAST_NAME=Al-Taiar LAST_NAME=lastname
GMAIL=example@gmail.com GMAIL=example@gmail.com
GMAIL_SMTP_PASSWORD=chan geme xyza bcde GMAIL_SMTP_PASSWORD=chan geme xyza bcde
@ -25,9 +25,9 @@ DOMAIN=example.com
API_DOMAIN=api.example.com API_DOMAIN=api.example.com
# Must not end with "/" # Must not end with "/"
ADDRESS_PROD=https://example.com ADDRESS_PROD=https://portfolio.example.com
ADDRESS_DEV=http://localhost:8910 ADDRESS_DEV=http://localhost:8910
API_ADDRESS_PROD=https://api.example.com API_ADDRESS_PROD=https://api-portfolio.example.com
API_ADDRESS_DEV=http://localhost:8911 API_ADDRESS_DEV=http://localhost:8911
MAX_HTTP_CONNECTIONS_PER_MINUTE=60 MAX_HTTP_CONNECTIONS_PER_MINUTE=60

View File

@ -13,9 +13,9 @@ DOMAIN=example.com
API_DOMAIN=api.example.com API_DOMAIN=api.example.com
# Must not end with "/" # Must not end with "/"
ADDRESS_PROD=https://example.com ADDRESS_PROD=https://portfolio.example.com
ADDRESS_DEV=http://localhost:8910 ADDRESS_DEV=http://localhost:8910
API_ADDRESS_PROD=https://api.example.com API_ADDRESS_PROD=https://api-portfolio.example.com
API_ADDRESS_DEV=http://localhost:8911 API_ADDRESS_DEV=http://localhost:8911
MAX_HTTP_CONNECTIONS_PER_MINUTE=60 MAX_HTTP_CONNECTIONS_PER_MINUTE=60

View File

@ -37,8 +37,16 @@ FROM base as api_build
# If your api side build relies on build-time environment variables, # If your api side build relies on build-time environment variables,
# specify them here as ARGs. (But don't put secrets in your Dockerfile!) # specify them here as ARGs. (But don't put secrets in your Dockerfile!)
#
# ARG MY_BUILD_TIME_ENV_VAR ARG ADDRESS_PROD
ARG API_ADDRESS_PROD
ARG ADDRESS_DEV
ARG API_ADDRESS_DEV
ARG MAX_HTTP_CONNECTIONS_PER_MINUTE
ARG GMAIL
ARG GMAIL_SMTP_PASSWORD
ARG FIRST_NAME
ARG LAST_NAME
COPY --chown=node:node api api COPY --chown=node:node api api
RUN yarn rw build api RUN yarn rw build api
@ -107,9 +115,9 @@ ENV NODE_ENV=production
# If you are using a custom server file, you must use the following # If you are using a custom server file, you must use the following
# command to launch your server instead of the default api-server below. # command to launch your server instead of the default api-server below.
# This is important if you intend to configure GraphQL to use Realtime. # This is important if you intend to configure GraphQL to use Realtime.
#
# CMD [ "./api/dist/server.js" ] CMD [ "./api/dist/server.js" ]
CMD [ "node_modules/.bin/rw-server", "api" ] # CMD [ "node_modules/.bin/rw-server", "api" ]
# web serve # web serve
# --------- # ---------

View File

@ -218,8 +218,7 @@ ${domain}/reset-password?resetToken=${resetToken}
Path: '/', Path: '/',
SameSite: isProduction ? 'None' : 'Strict', SameSite: isProduction ? 'None' : 'Strict',
Secure: isProduction, Secure: isProduction,
Domain: isProduction ? 'localhost' : 'localhost', Domain: isProduction ? process.env.DOMAIN : 'localhost',
// Domain: isProduction ? process.env.DOMAIN : 'localhost',
}, },
name: cookieName, name: cookieName,
}, },