Skip to content

Commit

Permalink
fix: dockerignore and unneccesary specification of .env
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Sep 22, 2024
1 parent 21cd3e9 commit e6ca42f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 73 deletions.
12 changes: 0 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,14 @@

# next.js
/.next/
/out/
next-env.d.ts

# production
/build

# misc
.DS_Store

# local env files
.env
.env*.local

# typescript
*.tsbuildinfo

# site map
public/sitemap.xml
public/robots.txt

# docker
Dockerfile*
.dockerignore
Expand Down
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.
# The ARGS in docker-compose.yml and the Dockerfile must also be updated.
# Also update any GitHub Actions that use these variables.

# General
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Executing remote SSH commands using SSH key
uses: appleboy/ssh-action@master
with:
username: ${{ secrets.USERNAME }}
host: ${{ secrets.HOST }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
git pull
bun run build
cd docs
docker compose down
docker compose up -d
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@

# next.js
/.next/
/out/
next-env.d.ts

# production
/build

# misc
.DS_Store

# local env files
.env
.env*.local

# typescript
*.tsbuildinfo
Expand Down
35 changes: 0 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,6 @@ COPY . .
ENV NODE_ENV=production
ENV SKIP_ENV_VALIDATION=true

# Set environment variables during the build
ARG NEXT_PUBLIC_SITE_URL
ARG DATABASE_USER
ARG DATABASE_PASSWORD
ARG DATABASE_HOST
ARG DATABASE_PORT
ARG DATABASE_NAME
ARG STORAGE_HOST
ARG STORAGE_PORT
ARG STORAGE_USER
ARG STORAGE_PASSWORD
ARG STORAGE_NAME
ARG FEIDE_CLIENT_ID
ARG FEIDE_CLIENT_SECRET
ARG FEIDE_AUTHORIZATION_ENDPOINT
ARG FEIDE_TOKEN_ENDPOINT
ARG FEIDE_USERINFO_ENDPOINT

ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL
ENV DATABASE_USER=$DATABASE_USER
ENV DATABASE_PASSWORD=$DATABASE_PASSWORD
ENV DATABASE_HOST=$DATABASE_HOST
ENV DATABASE_PORT=$DATABASE_PORT
ENV DATABASE_NAME=$DATABASE_NAME
ENV STORAGE_HOST=$STORAGE_HOST
ENV STORAGE_PORT=$STORAGE_PORT
ENV STORAGE_USER=$STORAGE_USER
ENV STORAGE_PASSWORD=$STORAGE_PASSWORD
ENV STORAGE_NAME=$STORAGE_NAME
ENV FEIDE_CLIENT_ID=$FEIDE_CLIENT_ID
ENV FEIDE_CLIENT_SECRET=$FEIDE_CLIENT_SECRET
ENV FEIDE_AUTHORIZATION_ENDPOINT=$FEIDE_AUTHORIZATION_ENDPOINT
ENV FEIDE_TOKEN_ENDPOINT=$FEIDE_TOKEN_ENDPOINT
ENV FEIDE_USERINFO_ENDPOINT=$FEIDE_USERINFO_ENDPOINT

# Build the application
RUN bun run build

Expand Down
19 changes: 0 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_USER
- DATABASE_PASSWORD
- DATABASE_NAME
- STORAGE_HOST
- STORAGE_PORT
- STORAGE_USER
- STORAGE_PASSWORD
- STORAGE_NAME
- FEIDE_CLIENT_ID
- FEIDE_CLIENT_SECRET
- FEIDE_AUTHORIZATION_ENDPOINT
- FEIDE_TOKEN_ENDPOINT
- FEIDE_USERINFO_ENDPOINT
- NEXT_PUBLIC_SITE_URL
env_file:
- .env
ports:
- "3000:3000"
db:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"lint": "biome check --write",
"prebuild": "next telemetry disable",
"build": "next build",
"postbuild": "next-sitemap && mkdir -p .next/standalone/public && mkdir -p .next/standalone/.next/static && cp -R public/* .next/standalone/public/ && cp -R .next/static/* .next/standalone/.next/static/",
"start": "bun run .next/standalone/server.js",
"db:start": "docker-compose up db",
"db:generate": "drizzle-kit generate",
Expand Down

0 comments on commit e6ca42f

Please sign in to comment.