Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker for development + backend production. Many things refactored to use env vars #4

Merged
merged 31 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
28f2444
Docker config added
horvbalint Jan 28, 2024
396941a
backend more ENV_VAR config
horvbalint Jan 28, 2024
c731f2d
dockerfile fixes
horvbalint Jan 28, 2024
935552b
experimental volume change
horvbalint Jan 28, 2024
6de4fbf
env_var configs
horvbalint Jan 28, 2024
c79d468
yaml type fix
horvbalint Jan 28, 2024
469b941
protocol fix
horvbalint Jan 28, 2024
dc6b47e
removed .env copy
horvbalint Jan 29, 2024
a919e1d
optional .env
horvbalint Jan 29, 2024
d05f931
error log
horvbalint Jan 29, 2024
be28202
experimental github workflow
horvbalint Jan 29, 2024
a3b9f69
maybe
horvbalint Jan 29, 2024
e3ee43f
maybe this
horvbalint Jan 29, 2024
d0fd04c
maybe this one
horvbalint Jan 29, 2024
19418d0
build frontend too
horvbalint Jan 29, 2024
b4eff95
fix
horvbalint Jan 29, 2024
c8f1c31
unused compose files removed
horvbalint Jan 29, 2024
e861f68
Merge branch 'docker' of https://github.com/horvbalint/speer into docker
horvbalint Jan 29, 2024
d9e2a7d
yaml change
horvbalint Jan 29, 2024
b010b5e
frontend build-args
horvbalint Jan 29, 2024
496f0e2
dockerfile updated
horvbalint Jan 29, 2024
c6b80d0
Logger (#3)
horvbalint Jan 31, 2024
1607afc
dependency update
horvbalint Jan 31, 2024
90c167a
fixes
horvbalint Jan 31, 2024
3bf5f40
debug
horvbalint Jan 31, 2024
9e557ac
removed frontend prod docker
horvbalint Jan 31, 2024
fb11273
mongodb logging
horvbalint Feb 3, 2024
111dd5c
actix-session: using redis-rs (fixes connection inside docker)
horvbalint Feb 3, 2024
caee315
slim production image
horvbalint Feb 3, 2024
1e8900c
avatar moved from "files" + static path escape fix
horvbalint Feb 3, 2024
77701bd
files removed from dockerfile.prod
horvbalint Feb 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
name: Create and publish a Docker image

# Configures this workflow to run every time a tag is created.
on:
push:
tags:
- "v*.*.*"

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Backend
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for backend
id: meta_backend
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend
# Building and pushing the backend image
- name: Build and push backend Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: ./backend
file: ./backend/dockerfile.prod
push: true
tags: ${{ steps.meta_backend.outputs.tags }}
labels: ${{ steps.meta_backend.outputs.labels }}
# - name: Deploy to Coolify
# run: |
# curl --request GET '${{ secrets.COOLIFY_WEBHOOK }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
5 changes: 5 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
files/*
target
config.json
.env
vapid.pem
Loading
Loading