From 77dcbc68269b05c7aa9692146eb9f68159c868f2 Mon Sep 17 00:00:00 2001 From: alexander taylor Date: Fri, 8 Dec 2023 13:36:08 -0800 Subject: [PATCH] Add devcontainer support (#202) --- .devcontainer/devcontainer.json | 47 +++++++++++++++++++++++++++++++++ README.md | 34 +++++++++++++++++------- 2 files changed, 71 insertions(+), 10 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..23e9059 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,47 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "Debian", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:bullseye", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": true, + "azureDnsAutoDetection": true, + "installDockerBuildx": true, + "version": "latest", + "dockerDashComposeVersion": "v1" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "16" // Match version from Dockerfile + }, + "ghcr.io/jungaretti/features/make:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.makefile-tools", + "golang.go", + "Vue.volar" + ] + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 8080, /* ADB main site (adb.dxe.io) */ + 8081 /* Members app (members.dxesf.org) */ + ] + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/README.md b/README.md index 4852b55..4391358 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,45 @@ [![Build Status](https://travis-ci.org/dxe/adb.svg?branch=master)](https://travis-ci.org/dxe/adb) -# adb -Activist Database Project +# ADB -## Run +Activist Database Project -First, download all the needed dependencies. Then start the server by running `make run_all` and going to localhost:8080. +## Local development -## Dependencies +### Dependencies You will need the following to run this project: -r * go * node.js v16 * docker -After installing the above, download all the go and node dependencies by running `make deps`. +After installing the above (already installed in the Devcontainer), download all +the go and node dependencies: + +```bash +make deps +``` -### Set up mysql locally for development +#### Set up mysql locally for development There is now a Docker container to run MySQL locally, so just run the following: -``` + +```bash docker compose up -d make dev_db ``` -## JS +### Run + +After downloading the dependencies, start the server: + +```bash +make run_all +``` + +Access the web app at http://localhost:8080. + +### JS This project uses webpack to compile our frontend files. Frontend files that need to be compiled are in `frontend/`, and the compiled