From c6350265430fff0d1e8cbb1c116eecd4657c6fb6 Mon Sep 17 00:00:00 2001 From: Jay Dungavath Date: Thu, 5 Dec 2024 16:35:30 -0500 Subject: [PATCH 1/3] still working on getting registry running in local docker containers --- .env.local | 39 +++++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ Dockerfile | 11 ++++++----- README.md | 3 ++- docker-compose.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++ entrypoint.sh | 10 ++++++++++ init.sql | 3 +++ registry | 2 ++ 8 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 .env.local create mode 100644 docker-compose.yml create mode 100644 entrypoint.sh create mode 100644 init.sql diff --git a/.env.local b/.env.local new file mode 100644 index 00000000..62313c8e --- /dev/null +++ b/.env.local @@ -0,0 +1,39 @@ +DB_DRIVER="postgres" +DB_HOST="postgres" +DB_NAME="apt_registry_development" +DB_USER="dev_user" +DB_PASSWORD="password" +DB_PORT=5432 +DB_USE_SSL=false +COOKIE_HASH_KEY='y0b6|UBJQ(N$KB)jAJYL-aj=:q?;yK64^TPch0=|1XNnv{X@QrL#?80u$1]LcBF' +COOKIE_BLOCK_KEY='4Qdnm4acxfAILGEFQ3jUj0PoLbMWbyMm' +COOKIE_DOMAIN="localhost" +SESSION_MAX_AGE=43200 +SESSION_COOKIE_NAME="aptrust_session" +FLASH_COOKIE_NAME="aptrust_flash" +PREFS_COOKIE_NAME="aptrust_prefs" +HTTPS_COOKIES=false +NSQ_URL='http://localhost:4151' +BATCH_DELETION_KEY="00000000-0000-0000-0000-000000000000" +EMAIL_SERVICE_TYPE="SMTP" +MAINTENANCE_MODE=false +ENABLE_TWO_FACTOR_SMS=false +SNS_ENDPOINT="" +AWS_SNS_USER="" +AWS_SNS_PWD="" +ENABLE_TWO_FACTOR_AUTHY=false +OTP_EXPIRATION="15m" +EMAIL_ENABLED=false +EMAIL_FROM_ADDRESS="help@aptrust.org" +REDIS_DEFAULT_DB= 0 +REDIS_PASSWORD="" +REDIS_URL="localhost:6379" +RETENTION_MINIMUM_GLACIER=90 +RETENTION_MINIMUM_GLACIER_DEEP=180 +RETENTION_MINIMUM_WASABI=90 +RETENTION_MINIMUM_STANDARD=0 +LOG_FILE="~/tmp/logs/registry_dev.log" +LOG_LEVEL=0 +LOG_CALLER=false +LOG_TO_CONSOLE=true +LOG_SQL=false \ No newline at end of file diff --git a/.gitignore b/.gitignore index da9234b4..972f3888 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ node_modules/ # Temp data used for seeing empty staging db db/seed + +# Ignore shared directory +shared \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7e988b7e..0a7c1b13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ # syntax=docker/dockerfile:1 -FROM golang:1.17.8-alpine +FROM golang:1.22.10-alpine3.20 -RUN apk update && \ - apk add --no-cache upx make build-base bash git +RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ + apk update && \ + apk add --no-cache upx make build-base bash git ENV CGO_ENABLED=0 \ - GOOS=linux \ - GOARCH=amd64 + GOOS=linux \ + GOARCH=amd64 WORKDIR /app diff --git a/README.md b/README.md index 9ca9a758..667be05a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build Status](https://travis-ci.com/APTrust/registry.svg?branch=master)](https://travis-ci.com/APTrust/registry) [![Maintainability](https://api.codeclimate.com/v1/badges/e4c7cfd351d6bae759e3/maintainability)](https://codeclimate.com/github/APTrust/registry/maintainability) [![REST API Documentation](https://img.shields.io/badge/documentation-REST%20API-blue)](https://aptrust.github.io/registry/) +