From 576ea7f1625e3b9db3956164824f85c19bb3b8e1 Mon Sep 17 00:00:00 2001 From: Yanik Proulx Date: Tue, 30 Jan 2024 13:58:40 -0500 Subject: [PATCH] docker and env prod sample --- .env.prod.sample | 47 ++++++++++++++++ ...ompose.sample => docker-compose.dev.sample | 54 +++++++++---------- docker-compose.prod.yml | 25 +++++++++ docker-compose.server.yml | 10 ---- 4 files changed, 99 insertions(+), 37 deletions(-) create mode 100644 .env.prod.sample rename docker-compose.sample => docker-compose.dev.sample (93%) create mode 100644 docker-compose.prod.yml delete mode 100644 docker-compose.server.yml diff --git a/.env.prod.sample b/.env.prod.sample new file mode 100644 index 0000000..1e0c995 --- /dev/null +++ b/.env.prod.sample @@ -0,0 +1,47 @@ +# Environment variables declared in this file are automatically made available to Prisma. +# See the documentation for more detail: https://pris.ly/d/prisma-schema#using-environment-variables + +# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server (Preview) and MongoDB (Preview). +# See the documentation for all the connection string options: https://pris.ly/d/connection-strings + +DATABASE_URL="mysql://[DB_USER]:[DB_PASSWORD]@db:3306/marathon" +PRISMA_LOG_QUERY="false" + +# Locale +DEFAULT_LOCALE="en" + +# Local development env +NODE_ENV=production +PORT=3001 + +# Auth +BEARER= +ALLOWED_ORIGINS="" + +# Storage +AWS_S3_REGION_NAME= +AWS_STORAGE_BUCKET_NAME= +AWS_S3_ENDPOINT_URL= +AWS_DEFAULT_ACL=public-read +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +PUBLIC_MEDIA_URI= + +# AssetBundles +ASSET_BUNDLE_FOLDER="asset-bundles" +DEFAULT_PLATFORM="webgl" + +# Marathon API +MARATHON_API="https://www.marathonhardware.com" +MARATHON_API_LOGIN="/drawer/login" +MARATHON_API_GRAPHQL="/pimcore-graphql-webservices/drawer-config" +MARATHON_API_GRAPHQL_KEY="" +MARATHON_API_CREATE_LIST="/drawer/createList" +MARATHON_API_SYNC="false" +MARATHON_SYNC_PRODUCTS_PER_PAGE="50" +MARATHON_SYNC_EMPTY_PAGES_TO_STOP="50" +MARATHON_MEDIA_URI="https://www.marathonhardware.com" +SYNC_AUTH="123" +MARATHON_COLLECTIONS_WHITELIST="area,imprint,autograph" +MARATHON_FINISHES_WHITELIST="walnut,birch,silk-white,matte-grey,matte-grey-textured,matte-black,stardust,silver-anodized,gold,silver-grey,chrome" +MARATHON_DRAWER_TYPES_WHITELIST="shallow,deep" diff --git a/docker-compose.sample b/docker-compose.dev.sample similarity index 93% rename from docker-compose.sample rename to docker-compose.dev.sample index 1ecd4c3..bc44d60 100644 --- a/docker-compose.sample +++ b/docker-compose.dev.sample @@ -1,27 +1,27 @@ -version: '3.7' - -x-common-props: &common-props - build: - context: ./ - target: base - working_dir: /base - volumes: - - ./:/base - env_file: - - .env - -services: - npm: - <<: *common-props - entrypoint: npm - dev: - <<: *common-props - ports: - - '${PORT}:${PORT}' - command: npm run dev - prod: - build: . - env_file: - - .env - ports: - - '${PORT}:${PORT}' +version: '3.7' + +x-common-props: &common-props + build: + context: ./ + target: base + working_dir: /base + volumes: + - ./:/base + env_file: + - .env + +services: + npm: + <<: *common-props + entrypoint: npm + dev: + <<: *common-props + ports: + - '${PORT}:${PORT}' + command: npm run dev + prod: + build: . + env_file: + - .env + ports: + - '${PORT}:${PORT}' diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..1f2df2e --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,25 @@ +version: '3.7' + +services: + db: + container_name: marathon-db + image: mysql:8.0 + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: marathon + MYSQL_USER: marathon + MYSQL_PASSWORD: whg-vha5UHE-tfu5cwt + volumes: + - ./data/mysql:/var/lib/mysql + ports: + - 3306:3306 + back: + container_name: marathon-back + build: . + links: + - db:db + env_file: + - .env + ports: + - '${PORT}:${PORT}' + diff --git a/docker-compose.server.yml b/docker-compose.server.yml deleted file mode 100644 index 5eb80b3..0000000 --- a/docker-compose.server.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3' - -services: - be: - image: 'ghcr.io/perimetre/marathon-backend:${DOCKER_IMAGE_TAG}' - restart: always - env_file: - - .env - ports: - - '${PORT}:${PORT}'