-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.multi
99 lines (73 loc) · 2.22 KB
/
Dockerfile.multi
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# syntax=docker/dockerfile:1
FROM golang:alpine3.19 AS builder
RUN apk update && apk add --no-cache upx make build-base bash git openssl bind-tools curl
ENV CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . .
RUN go build -o ./main
FROM golang:alpine3.19
RUN apk update && apk add --no-cache upx make build-base bash git openssl bind-tools curl
WORKDIR /app
COPY --from=builder /app/main /app/main
COPY --from=builder /app/static /app/static
COPY --from=builder /app/views /app/views
COPY --from=builder /app/alert_templates /app/alert_templates
COPY --from=builder /app/.env.docker /app/.env.docker
#Environment VARS for deployment
ENV APT_ENV=docker
ENV DB_DRIVER="postgres"
ENV DB_HOST="localhost"
ENV DB_NAME="apt_registry_staging"
ENV DB_USER="dev_user"
ENV DB_PASSWORD="password"
ENV DB_PORT=5432
ENV DB_USE_SSL=false
ENV COOKIE_HASH_KEY='y0b6|UBJQ(N$KB)jAJYL-aj=:q?;yK64^TPch0=|1XNnv{X@QrL#?80u$1]LcBF'
ENV COOKIE_BLOCK_KEY='4Qdnm4acxfAILGEFQ3jUj0PoLbMWbyMm'
ENV COOKIE_DOMAIN="localhost"
ENV SESSION_MAX_AGE=43200
ENV SESSION_COOKIE_NAME="aptrust_session"
ENV FLASH_COOKIE_NAME="aptrust_flash"
ENV PREFS_COOKIE_NAME="aptrust_prefs"
ENV HTTPS_COOKIES=false
ENV NSQ_URL="http://localhost:4151"
ENV AWS_ACCESS_KEY_ID=<yourkeyid>
ENV AWS_SECRET_ACCESS_KEY=<yoursecretkey>
ENV AWS_REGION=us-east-1
ENV ENABLE_TWO_FACTOR_SMS=true
ENV ENABLE_TWO_FACTOR_AUTHY=true
ENV AUTHY_API_KEY=<yourkey>
ENV OTP_EXPIRATION="15m"
ENV EMAIL_ENABLED=false
ENV EMAIL_FROM_ADDRESS="[email protected]"
ENV REDIS_DEFAULT_DB=0
ENV REDIS_PASSWORD=""
ENV REDIS_URL="localhost:6379"
#systems vars
ENV LOG_FILE="STDOUT"
ENV LOG_LEVEL=0
ENV LOG_CALLER=false
ENV LOG_TO_CONSOLE=true
ENV LOG_SQL=false
ENV AWS_SES_PWD=password
ENV SES_ENDPOINT=smtp.mail.com
ENV SNS_ENDPOINT=sns.local.com
ENV BATCH_DELETION_KEY=key
ENV MAINTENANCE_MODE=false
ENV EMAIL_SERVICE_TYPE=SMTP
ENV AWS_SNS_PWD=password
#Storage retention periods.
ENV RETENTION_MINIMUM_GLACIER=0
ENV RETENTION_MINIMUM_GLACIER_DEEP=0
ENV RETENTION_MINIMUM_WASABI=0
ENV RETENTION_MINIMUM_STANDARD=0
# Making a note for a new dockerfile test.
EXPOSE 8080
CMD ["./main" ]