From 4940fe4d674e6682d2dc4e4799497a79702a06e4 Mon Sep 17 00:00:00 2001 From: sergeyyarkov Date: Thu, 25 May 2023 17:59:52 +0300 Subject: [PATCH] setup env durion astro build --- compose.yml | 8 ++++++-- scripts/hello.sh | 2 -- website/.dockerignore | 3 ++- website/.env.example | 2 +- website/Dockerfile | 10 +++++++++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/compose.yml b/compose.yml index 3e87578..b927b0d 100644 --- a/compose.yml +++ b/compose.yml @@ -9,13 +9,15 @@ services: - 'cms.localhost:127.0.0.1' args: - 'CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S)' + - 'DIRECTUS_URL=http://cms.localhost' + - 'DIRECTUS_EMAIL=admin@example.com' + - 'DIRECTUS_PASSWORD=d1r3ctu5' + - 'DIRECTUS_STATIC_TOKEN=' image: astroweb:v1.0 networks: - directus volumes: - './website/nginx/conf.d:/etc/nginx/conf.d:rw' - env_file: - - ./website/.env nginx: restart: 'always' @@ -69,6 +71,8 @@ services: DB_PASSWORD: 'directus' ADMIN_EMAIL: 'admin@example.com' ADMIN_PASSWORD: 'd1r3ctu5' + # PUBLIC_URL: 'https://cms.localhost' + volumes: db-data: uploads: diff --git a/scripts/hello.sh b/scripts/hello.sh index 201ef51..314d4d4 100755 --- a/scripts/hello.sh +++ b/scripts/hello.sh @@ -8,6 +8,4 @@ say_hello sleep 1 say_hello sleep 1 -say_hello -sleep 1 say_hello \ No newline at end of file diff --git a/website/.dockerignore b/website/.dockerignore index 60bd8ca..fc6abc0 100644 --- a/website/.dockerignore +++ b/website/.dockerignore @@ -1,3 +1,4 @@ ./node_modules ./dist -./.astro \ No newline at end of file +./.astro +./.env \ No newline at end of file diff --git a/website/.env.example b/website/.env.example index e31037a..e499512 100644 --- a/website/.env.example +++ b/website/.env.example @@ -1,4 +1,4 @@ -PUBLIC_DIRECTUS_URL=http://localhost:8055 +DIRECTUS_URL=http://localhost:8055 DIRECTUS_EMAIL=admin@example.com DIRECTUS_PASSWORD=d1r3ctu5 DIRECTUS_STATIC_TOKEN= \ No newline at end of file diff --git a/website/Dockerfile b/website/Dockerfile index e61c814..90c4a24 100644 --- a/website/Dockerfile +++ b/website/Dockerfile @@ -16,10 +16,18 @@ EXPOSE 3000 CMD [ "npm", "start" ] ARG CACHE_DATE=not_a_date +ARG DIRECTUS_URL=http://cms.localhost +ARG DIRECTUS_EMAIL=admin@example.com +ARG DIRECTUS_PASSWORD=d1r3ctu5 +ARG DIRECTUS_STATIC_TOKEN= + +ENV DIRECTUS_URL=${DIRECTUS_URL} +ENV DIRECTUS_EMAIL=${DIRECTUS_EMAIL} +ENV DIRECTUS_PASSWORD=${DIRECTUS_PASSWORD} +ENV DIRECTUS_STATIC_TOKEN=${DIRECTUS_STATIC_TOKEN} FROM development as builder WORKDIR /app -ENV DIRECTUS_URL=http://cms.localhost RUN npm run build FROM ${NGINX_IMAGE} as production