diff --git a/Dockerfile b/portfolio/Dockerfile similarity index 100% rename from Dockerfile rename to portfolio/Dockerfile diff --git a/docker-compose.yml b/portfolio/docker-compose.yml similarity index 92% rename from docker-compose.yml rename to portfolio/docker-compose.yml index 5c8bb81..112807b 100644 --- a/docker-compose.yml +++ b/portfolio/docker-compose.yml @@ -7,12 +7,12 @@ services: - .env container_name: web build: - context: ./portfolio - dockerfile: ../Dockerfile + context: . + dockerfile: Dockerfile target: build # comment out volumes when target is prod - volumes: - - './portfolio:/app' + # volumes: + # - './src:/app' # comment out ports in prod, traffic only through proxy ports: - ${NODE_PORT}:${NODE_PORT} @@ -20,6 +20,8 @@ services: - portfolio environment: - CHOKIDAR_USEPOLLING=true + depends_on: + - database database: env_file: - .env @@ -43,7 +45,7 @@ services: environment: NGINX_ENVSUBST_TEMPLATE_SUFFIX: ".conf" build: - context: ./portfolio/nginx + context: ./nginx dockerfile: Dockerfile ports: - 8005:${NGINX_PORT} diff --git a/portfolio/src/package.json b/portfolio/src/package.json index fe514dd..7afb8e4 100644 --- a/portfolio/src/package.json +++ b/portfolio/src/package.json @@ -6,12 +6,12 @@ "pg": "^8.11.5" }, "scripts": { - "build-db": ". ../../.env && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ./scripts/build-db.sql", - "clean-db": ". ../../.env && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ./scripts/clean-db.sql", - "build-db-local": ". ../../.env.local && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ../scripts/build-db.sql", - "clean-db-local": ". ../../.env.local && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ../scripts/clean-db.sql", - "build-db-docker": ". ../../.env.docker && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ./scripts/build-db.sql", - "clean-db-docker": ". ../../.env.docker && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ./scripts/clean-db.sql" + "build-db": ". ../.env && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ./scripts/build-db.sql", + "clean-db": ". ../.env && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ./scripts/clean-db.sql", + "build-db-local": ". ../.env.local && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ../scripts/build-db.sql", + "clean-db-local": ". ../.env.local && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ../scripts/clean-db.sql", + "build-db-docker": ". ../.env && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ../scripts/build-db.sql", + "clean-db-docker": ". ../.env && PGPASSWORD=$POSTGRES_PASSWORD psql -e -h localhost -d $POSTGRES_DB -U $POSTGRES_USER -p 5433 -f ../scripts/clean-db.sql" }, "name": "portfolio", "version": "1.0.0",