This repository was archived by the owner on Feb 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env
More file actions
63 lines (55 loc) · 2.75 KB
/
.env
File metadata and controls
63 lines (55 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: Apache-2.0 #
######################################################################
# Source helper functions
source .fun
# Proxy settings [optional] - set if your network requires a proxy to connect to the Internet
export http_proxy=
export https_proxy=
export no_proxy=localhost
# AWS Settings
## AWS_REGION
export AWS_REGION=$(aws ec2 describe-availability-zones --output text --query 'AvailabilityZones[0].[RegionName]')
export AWS_REGION=${AWS_REGION:-us-west-2}
# Docker image settings
## REGISTRY: [optional] - Docker registry path including trailing "/". Example: registry.company.com/demo/
## If REGISTRY==default, then the default elastic container registry in the account for the current region will be used
export REGISTRY=default
## Set default registry if needed
if [ "$REGISTRY" == "default" ]; then
export REGION=${AWS_REGION}
export ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
if [ "$ACCOUNT" == "" ]; then
export REGISTRY=""
else
export REGISTRY=${ACCOUNT}.dkr.ecr.${REGION}.amazonaws.com/
fi
fi
## Add trailing forward slash if needed
if [ -n "${REGISTRY}" ]; then
if [ "${REGISTRY: -1}" != "/" ]; then
export REGISTRY="${REGISTRY}/"
fi
fi
## IMAGE: <required> - Docker image name for this project. Example: myapp
export IMAGE=aws-do-cli
## VERSION: [optional] - Version tag for this Docker image. Example: v20180302
#export VERSION=v$(date +%Y%m%d)
export VERSION=v20230411
export TAG=$(if [ -z "${VERSION}" ]; then echo ""; else echo ":${VERSION}"; fi)
## BUILD_OPTS: [optional] - arguments for the docker image build command
export BUILD_OPTS="--progress=plain --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg no_proxy=${no_proxy}"
# Docker container runtime settings
## CONTAINER_NAME: [optional] - Name of the Docker container including the --name switch. Example --name myapp
export CONTAINER=${IMAGE}
export CONTAINER_NAME="--name ${CONTAINER}"
## Port map [optional] - Mapping of external to internal ports including the -p switch. Example -p 80:8080
#export PORT_MAP="-p 80:8080"
## Volume map [optional] - Mapping of external to internal paths including the -v switch. Example $(pwd):/wd
export VOL_MAP="-v ${HOME}/.aws:/root/.aws -v $(pwd):/aws-do-cli"
## Network [optional] - Network name including the --net switch. Example --net mynet
export NETWORK=
## RUN_OPTS [optional] - additional options to specify with the run comman. Example -e POSTGRES_DB=dbname
export RUN_OPTS="-e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy"