-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Postgres,Redis,GoogleCloud,Traefik,Docker-Compose,Vue3 Account Client…
… are done
- Loading branch information
fshmidt
committed
Feb 8, 2023
0 parents
commit d42cfa7
Showing
75 changed files
with
10,470 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.env | ||
*.pem | ||
test.go | ||
serviceAccount.json | ||
.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM golang:1.19-alpine3.17 AS builder | ||
|
||
ENV GO111MODULE=on | ||
|
||
RUN go version | ||
|
||
COPY . /github.com/fshmidt/game-site/ | ||
WORKDIR /github.com/fshmidt/game-site/ | ||
|
||
RUN go mod download | ||
RUN go install github.com/cespare/reflex@latest | ||
|
||
RUN GOOS=linux go build -o ./.bin/site ./cmd/main.go ./cmd/data_sources.go ./cmd/injection.go | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk --no-cache add ca-certificates | ||
|
||
WORKDIR /root/ | ||
|
||
COPY --from=0 /github.com/fshmidt/game-site/.bin/site . | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["./site"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.PHONY: keypair migrate-create migrate-up migrate-down migrate-force | ||
|
||
PWD = $(shell pwd) | ||
ACCTPATH = $(PWD) | ||
MPATH = $(ACCTPATH)/migrations | ||
PORT = 5432 | ||
|
||
# Default number of migrations to execute up or down | ||
N = 1 | ||
|
||
migrate-create: | ||
@echo "----Creating migration----" | ||
migrate create -ext sql -dir $(MPATH) -seq -digits 5 $(NAME) | ||
|
||
migrate-up: | ||
migrate -source file://$(MPATH) -database postgres://postgres:password@localhost:$(PORT)/postgres?sslmode=disable up $(N) | ||
|
||
migrate-down: | ||
migrate -source file://$(MPATH) -database postgres://postgres:password@localhost:$(PORT)/postgres?sslmode=disable down $(N) | ||
|
||
migrate-force: | ||
migrate -source file://$(MPATH) -database postgres://postgres:password@localhost:$(PORT)/postgres?sslmode=disable force $(VERSION) | ||
|
||
# Create keypair should be in your file below | ||
|
||
create-keypair: | ||
@echo "Creating an rsa 256 key pair" | ||
openssl genpkey -algorithm RSA -out $(ACCTPATH)/rsa_private_$(ENV).pem -pkeyopt rsa_keygen_bits:2048 | ||
openssl rsa -in $(ACCTPATH)/rsa_private_$(ENV).pem -pubout -out $(ACCTPATH)/rsa_public_$(ENV).pem | ||
|
||
# create dev and test keys | ||
# run postgres containers in docker-compose | ||
# migrate down | ||
# migrate up | ||
# docker-compose dwon | ||
init: | ||
docker-compose up -d postgres-account && \ | ||
$(MAKE) create-keypair ENV=dev && \ | ||
$(MAKE) create-keypair ENV=test && \ | ||
$(MAKE) migrate-down APPPATH=account N= && \ | ||
$(MAKE) migrate-up APPPATH=account N= && \ | ||
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/* | ||
.git | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": ["eslint:recommended", "plugin:vue/vue3-essential"], | ||
"rules": { | ||
"no-unused-vars": [1, { "args": "all", "argsIgnorePattern": "^_" }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM node:lts-alpine | ||
|
||
# make the 'app' folder the current working directory | ||
WORKDIR /app | ||
|
||
# add `/app/node_modules/.bin` to $PATH - allow running 'vite' | ||
#ENV PATH /app/node_modules/.bin:$PATH | ||
|
||
# copy both 'package.json' and 'package-lock.json' (if available) | ||
COPY package*.json ./ | ||
|
||
# install project dependencies | ||
|
||
|
||
# copy project files and folders to the current working directory (i.e. 'app' folder) | ||
COPY . . | ||
RUN npm install --unsafe-perm=true --allow-root | ||
RUN npm install [email protected] --unsafe-perm=true --allow-root | ||
#RUN chown -R node ~/.npm | ||
#RUN chown -R node /app/node_modules/ | ||
CMD [ "npm", "run", "dev", "--unsafe-perm=true", "--allow-root"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM node:lts-alpine AS build | ||
|
||
# make the 'app' folder the current working directory | ||
WORKDIR /app | ||
|
||
# add `/app/node_modules/.bin` to $PATH - allow running 'vite' | ||
#ENV PATH /app/node_modules/.bin:$PATH | ||
|
||
# copy both 'package.json' and 'package-lock.json' (if available) | ||
COPY package*.json ./ | ||
|
||
# install project dependencies | ||
#RUN mkdir -p /app/node_modules | ||
# | ||
#RUN chown -R node:node /app/node_modules | ||
COPY . . | ||
# RUN npm ci | ||
RUN npm run build | ||
#RUN mkdir -p /app/node_modules/.vite/deps_temp | ||
# EXPOSE 3000 | ||
# copy project files and folders to the current working directory (i.e. 'app' folder) | ||
|
||
FROM nginx:1.22.1-alpine AS prod-stage | ||
COPY --from=build /app/dist /usr/share/nginx/html/account | ||
EXPOSE 3000 | ||
CMD ["nginx", "-g", "daemon off;"] | ||
|
||
# CMD [ "npm", "run", "dev" ] | ||
|
||
# FROM node:lts-alpine AS build | ||
# WORKDIR /app | ||
# COPY package.json ./ | ||
# RUN npm install | ||
# COPY . . | ||
# RUN npm run build | ||
|
||
# FROM nginx:1.22.1-alpine AS prod-stage | ||
# COPY --from=build /app/dist /usr/share/nginx/html | ||
# EXPOSE 3000 | ||
# CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Vue 3 + Vite | ||
|
||
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. | ||
|
||
## Recommended IDE Setup | ||
|
||
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + Vue</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"include": [ | ||
"./src/**/*" | ||
] | ||
} |
Oops, something went wrong.