Skip to content

Commit

Permalink
add destroy, update node version in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeket committed May 26, 2024
1 parent 8b30861 commit 309ad2e
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 13 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/destroy-infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: destroy-infra

on: [workflow_dispatch]

jobs:
destroy:
name: Destroy infrastructure
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'infrastructure'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Tofu
uses: opentofu/setup-opentofu@v1

- name: Init
run: tofu init
env:
TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }}

- name: Destroy
run: tofu destroy -input=false -auto-approve
env:
TF_VAR_GITHUB_SERVER_URL: ${{ github.server_url }}
TF_VAR_GITHUB_REPOSITORY: ${{ github.repository }}
TF_VAR_do_token: ${{ secrets.DO_PAT }}
TF_VAR_pub_key: ${{ secrets.PUB_KEY }}
TF_VAR_DATABASE_URL: ${{ secrets.DATABASE_URL }}
TF_VAR_POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
TF_VAR_NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
TF_VAR_NEXT_PUBLIC_TG_BOT_NAME: ${{ secrets.NEXT_PUBLIC_TG_BOT_NAME }}
TF_VAR_TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TF_VAR_FORUM_ROOT_NAME: ${{ secrets.FORUM_ROOT_NAME }}
TF_VAR_TG_ACTIVE_GROUP_IDS: ${{ secrets.TG_ACTIVE_GROUP_IDS }}
TF_VAR_TG_ADMIN_GROUP_IDS: ${{ secrets.TG_ADMIN_GROUP_IDS }}
TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }}
2 changes: 1 addition & 1 deletion docker/Dockerfile.dbsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:16-alpine3.16
FROM --platform=linux/amd64 node:lts-alpine
RUN apk add --no-cache libc6-compat openssl1.1-compat --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
WORKDIR /app
RUN yarn global add pnpm typescript ts-node
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##### DEVELOPMENT DOCKER IMAGE
##### DEPENDENCIES
FROM --platform=linux/amd64 node:16-alpine3.16
FROM --platform=linux/amd64 node:lts-alpine
RUN apk add --no-cache libc6-compat openssl1.1-compat --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
WORKDIR /app
RUN yarn global add pnpm
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##### DEPENDENCIES

FROM --platform=linux/amd64 node:16-alpine3.16 as deps
FROM --platform=linux/amd64 node:lts-alpine as deps
RUN apk add --no-cache libc6-compat openssl1.1-compat-libs-static --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
WORKDIR /app

Expand All @@ -22,7 +22,7 @@ RUN \

##### BUILDER

FROM --platform=linux/amd64 node:16-alpine3.16 AS builder
FROM --platform=linux/amd64 node:lts-alpine AS builder
RUN apk add --no-cache libc6-compat openssl1.1-compat-libs-static --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
RUN yarn global add pnpm
ARG DATABASE_URL
Expand All @@ -48,7 +48,7 @@ RUN --mount=type=secret,id=NEXT_PUBLIC_TG_BOT_NAME \

##### RUNNER

FROM --platform=linux/amd64 node:16-alpine3.16 AS runner
FROM --platform=linux/amd64 node:lts-alpine AS runner
RUN apk add --no-cache libc6-compat openssl1.1-compat-libs-static --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
RUN yarn global add pnpm
WORKDIR /app
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
name: hytky-dev
services:
dev:
Expand All @@ -18,7 +17,7 @@ services:
condition: service_healthy
restart: always
postgres:
image: "postgres:15.1-alpine"
image: "postgres:alpine"
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose.prod.from-registry.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
name: hytky-prod
services:
nginx:
Expand Down Expand Up @@ -26,7 +25,7 @@ services:
restart: always

postgres:
image: "postgres:15.1-alpine"
image: "postgres:alpine"
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose.prod.tls-registry.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
name: hytky-prod
services:
nginx:
Expand Down Expand Up @@ -30,7 +29,7 @@ services:
restart: unless-stopped

postgres:
image: "postgres:15.1-alpine"
image: "postgres:alpine"
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
name: hytky-prod
services:
nginx:
Expand Down Expand Up @@ -29,7 +28,7 @@ services:
restart: always

postgres:
image: "postgres:15.1-alpine"
image: "postgres:alpine"
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
Expand Down

0 comments on commit 309ad2e

Please sign in to comment.