Merge pull request #106 from bijeebuss/main

bare bones docker setup
This commit is contained in:
Daniel 2023-08-03 14:24:24 -04:00 committed by GitHub
commit 49423ddb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 81 additions and 1 deletions

View File

@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// 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": "yarn install",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
node_modules
pgdata
.env
.devcontainer
docker-compose.yml
Dockerfile
README.md

View File

@ -25,4 +25,7 @@ PRICE_ID=
NEXT_PUBLIC_TRIAL_PERIOD_DAYS=
NEXT_PUBLIC_STRIPE_BILLING_PORTAL_URL=
BASE_URL=http://localhost:3000
NEXT_PUBLIC_PRICING=
NEXT_PUBLIC_PRICING=
# Docker postgres settings
POSTGRES_PASSWORD=

3
.gitignore vendored
View File

@ -42,3 +42,6 @@ next-env.d.ts
/test-results/
/playwright-report/
/playwright/.cache/
# docker
pgdata

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
# playwright doesnt support debian image
FROM ubuntu:focal
run apt-get update && apt-get install wget xz-utils -y
RUN mkdir /data
WORKDIR /data
RUN wget https://nodejs.org/dist/v20.5.0/node-v20.5.0-linux-x64.tar.xz -O nodejs.tar.xz \
&& mkdir /opt/nodejs \
&& tar -xf nodejs.tar.xz --strip-components 1 -C /opt/nodejs \
&& rm nodejs.tar.xz
ENV PATH="$PATH:/opt/nodejs/bin"
RUN npm install -g yarn
COPY ./package.json ./yarn.lock ./playwright.config.ts .
RUN yarn
RUN npx playwright install-deps
COPY . .
RUN yarn prisma generate
RUN yarn build
CMD yarn prisma migrate deploy && yarn start

18
docker-compose.yml Normal file
View File

@ -0,0 +1,18 @@
version: "3.5"
services:
linkwarden:
env_file: .env
restart: always
build: .
ports:
- 3000:3000
volumes:
- /var/lib/elasticsearch/data
postgres:
image: postgres
env_file: .env
restart: always
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata: