dockerize dev env
This commit is contained in:
parent
955d1aa1b2
commit
50477c1b65
|
@ -0,0 +1,48 @@
|
|||
############################################################################
|
||||
# AUTH / OPTIONAL #
|
||||
# if you want to work on logged in features, you'll need some kind of auth #
|
||||
############################################################################
|
||||
|
||||
# github
|
||||
GITHUB_ID=<YOUR GITHUB ID>
|
||||
GITHUB_SECRET=<YOUR GITHUB SECRET>
|
||||
|
||||
# twitter
|
||||
TWITTER_ID=<YOUR TWITTER ID>
|
||||
TWITTER_SECRET=<YOUR TWITTER SECRET>
|
||||
|
||||
# email
|
||||
LOGIN_EMAIL_SERVER=smtp://<YOUR EMAIL>:<YOUR PASSWORD>@<YOUR SMTP DOMAIN>:587
|
||||
LOGIN_EMAIL_FROM=<YOUR FROM ALIAS>
|
||||
|
||||
# lnurl-auth
|
||||
LNAUTH_URL=<YOUR PUBLIC TUNNEL TO LOCALHOST, e.g. NGROK>
|
||||
|
||||
#######################################################
|
||||
# LND / OPTIONAL #
|
||||
# if you want to work with payments you'll need these #
|
||||
#######################################################
|
||||
|
||||
# lnd
|
||||
LND_CERT=<YOUR LND HEX CERT>
|
||||
LND_MACAROON=<YOUR LND HEX MACAROON>
|
||||
LND_SOCKET=<YOUR LND GRPC HOST>:<YOUR LND GRPC PORT>
|
||||
|
||||
###############
|
||||
# LEAVE AS IS #
|
||||
###############
|
||||
|
||||
# static things
|
||||
NEXTAUTH_URL=http://localhost:3000/api/auth
|
||||
SELF_URL=http://localhost:3000
|
||||
LND_CONNECT_ADDRESS=03cc1d0932bb99b0697f5b5e5961b83ab7fd66f1efc4c9f5c7bad66c1bcbe78f02@xhlmkj7mfrl6ejnczfwl2vqik3xim6wzmurc2vlyfoqw2sasaocgpuad.onion:9735
|
||||
NEXTAUTH_SECRET=3_0W_PhDRZVanbeJsZZGIEljexkKoGbL6qGIqSwTjjI
|
||||
JWT_SIGNING_PRIVATE_KEY={"kty":"oct","kid":"FvD__hmeKoKHu2fKjUrWbRKfhjimIM4IKshyrJG4KSM","alg":"HS512","k":"3_0W_PhDRZVanbeJsZZGIEljexkKoGbL6qGIqSwTjjI"}
|
||||
|
||||
# prisma db url
|
||||
DATABASE_URL="postgresql://sn:password@db:5432/stackernews?schema=public"
|
||||
|
||||
# postgres container stuff
|
||||
POSTGRES_PASSWORD=password
|
||||
POSTGRES_USER=sn
|
||||
POSTGRES_DB=stackernews
|
|
@ -26,6 +26,7 @@ yarn-error.log*
|
|||
|
||||
# local env files
|
||||
.env
|
||||
envbak
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM node:14.17.0
|
||||
|
||||
ENV NODE_ENV=development
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD npm install --loglevel verbose; npx prisma migrate dev; npm run dev
|
|
@ -0,0 +1,25 @@
|
|||
version: "3"
|
||||
services:
|
||||
db:
|
||||
container_name: db
|
||||
image: postgres
|
||||
restart: always
|
||||
expose:
|
||||
- "5432"
|
||||
ports:
|
||||
- "5431:5432"
|
||||
env_file:
|
||||
- .env.sample
|
||||
app:
|
||||
container_name: app
|
||||
build: ./
|
||||
depends_on:
|
||||
- db
|
||||
env_file:
|
||||
- .env.sample
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./:/app
|
||||
links:
|
||||
- db
|
|
@ -2,12 +2,14 @@ const { withPlausibleProxy } = require('next-plausible')
|
|||
|
||||
module.exports = withPlausibleProxy()({
|
||||
compress: false,
|
||||
generateBuildId: async () => {
|
||||
// use the app version which eb doesn't otherwise give us
|
||||
// as the build id
|
||||
generateBuildId: process.env.NODE_ENV === 'development'
|
||||
? undefined
|
||||
: async () => {
|
||||
// use the app version which eb doesn't otherwise give us
|
||||
// as the build id
|
||||
const { RuntimeSources } = require('/opt/elasticbeanstalk/deployment/app_version_manifest.json') // eslint-disable-line
|
||||
return Object.keys(RuntimeSources['stacker.news'])[0]
|
||||
},
|
||||
return Object.keys(RuntimeSources['stacker.news'])[0]
|
||||
},
|
||||
async rewrites () {
|
||||
return [
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
104
prisma/seed.js
104
prisma/seed.js
|
@ -30,43 +30,107 @@ async function main () {
|
|||
}
|
||||
})
|
||||
|
||||
await prisma.item.upsert({
|
||||
where: { id: 0 },
|
||||
update: {},
|
||||
create: {
|
||||
await prisma.item.create({
|
||||
data: {
|
||||
title: 'System76 Developing “Cosmic” Desktop Environment',
|
||||
url: 'https://blog.system76.com/post/648371526931038208/cosmic-to-arrive-in-june-release-of-popos-2104',
|
||||
userId: satoshi.id
|
||||
userId: satoshi.id,
|
||||
children: {
|
||||
create: {
|
||||
userId: k00b.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: satoshi.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: greg.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
await prisma.item.upsert({
|
||||
where: { id: 1 },
|
||||
update: {},
|
||||
create: {
|
||||
await prisma.item.create({
|
||||
data: {
|
||||
title: 'Deno 1.9',
|
||||
url: 'https://deno.com/blog/v1.9',
|
||||
userId: k00b.id
|
||||
userId: k00b.id,
|
||||
children: {
|
||||
create: {
|
||||
userId: satoshi.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: k00b.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: stan.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
await prisma.item.upsert({
|
||||
where: { id: 2 },
|
||||
update: {},
|
||||
create: {
|
||||
await prisma.item.create({
|
||||
data: {
|
||||
title: '1Password Secrets Automation',
|
||||
url: 'https://blog.1password.com/introducing-secrets-automation/',
|
||||
userId: greg.id
|
||||
userId: greg.id,
|
||||
children: {
|
||||
create: {
|
||||
userId: k00b.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: satoshi.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: greg.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
await prisma.item.upsert({
|
||||
where: { id: 3 },
|
||||
update: {},
|
||||
create: {
|
||||
await prisma.item.create({
|
||||
data: {
|
||||
title: '‘Counter Strike’ Bug Allows Hackers to Take over a PC with a Steam Invite',
|
||||
url: 'https://www.vice.com/en/article/dyvgej/counter-strike-bug-allows-hackers-to-take-over-a-pc-with-a-steam-invite',
|
||||
userId: stan.id
|
||||
userId: stan.id,
|
||||
children: {
|
||||
create: {
|
||||
userId: greg.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: stan.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
||||
children: {
|
||||
create: {
|
||||
userId: k00b.id,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue