Skip to content

Commit

Permalink
Refactor (#83)
Browse files Browse the repository at this point in the history
* removed sqlboiler generated chembl models.

* removed and archived download related functions and commands.

* removed chembl_schema.sql

* removed chembl schema and chembl test

* updated license authors and date.

* removed old boilerplate.

* reverted back to Keoni's original implementation.

* go modify and delete bloat that has been archived

* removed dev container contents.

* added basic postgres code to main.go

* established basic web server with config defaults for development.
  • Loading branch information
TimothyStiles authored Sep 9, 2023
1 parent 059646a commit 6c4ec32
Show file tree
Hide file tree
Showing 143 changed files with 471 additions and 130,192 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM mcr.microsoft.com/devcontainers/go:1-1.21-bullseye

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment the next lines to use go get to install anything else you need
# USER vscode
# RUN go get -x <your-dependency-or-tool>
# USER root

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
8 changes: 8 additions & 0 deletions .devcontainer/app.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
POSTGRES_HOST=localhost
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_PORT=5432

PORT=8000
CLIENT_ORIGIN=http://localhost:3000
23 changes: 0 additions & 23 deletions .devcontainer/dev/.helmignore

This file was deleted.

14 changes: 0 additions & 14 deletions .devcontainer/dev/Chart.yaml

This file was deleted.

Binary file removed .devcontainer/dev/charts/postgresql-12.6.6.tgz
Binary file not shown.
4 changes: 0 additions & 4 deletions .devcontainer/dev/templates/configmap.yml

This file was deleted.

48 changes: 13 additions & 35 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube
// README at: https://github.com/devcontainers/templates/tree/main/src/go-postgres
{
"name": "ark-devcontainer",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"name": "Go & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"enableNonRootDocker": "true",
"moby": "true"
},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest",
"helm": "latest",
"minikube": "latest"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "latest",
"golangciLintVersion": "latest"
},
"ghcr.io/mpriscella/features/kind:1": {
"version": "latest"
}
},

"extensions": ["golang.go","premparihar.gotestexplorer","github.vscode-pull-request-github","eamodio.gitlens"],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "kubectl version",

// Use 'postStartCommand' to run commands after the container is created like starting minikube.
"postStartCommand": "kind create cluster && helm install dev .devcontainer/dev",
// "postStartCommand": "nohup bash -c 'minikube start &' > minikube.log 2>&1 && helm install dev .devcontainer/dev",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Configure tool-specific properties.
// "customizations": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5432],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

38 changes: 38 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3.8'

volumes:
postgres-data:

services:
app:
build:
context: .
dockerfile: Dockerfile
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

db:
image: postgres:15-bullseye
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- app.env


# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 Keoni Gandall, Timothy Stiles
Copyright 2023 Timothy Stiles, Keoni Gandall

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
1 change: 0 additions & 1 deletion app/app.go

This file was deleted.

1 change: 0 additions & 1 deletion client/client.go

This file was deleted.

Loading

0 comments on commit 6c4ec32

Please sign in to comment.