Skip to content

Commit

Permalink
feat: run locally with docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
jannawro committed Sep 28, 2024
1 parent bf73808 commit 888e0e6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 35 deletions.
29 changes: 2 additions & 27 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
version: "3"

vars:
NAME: blogserver
TAG:
sh: git rev-parse HEAD
PORT: 8888
API_KEY: "anapikey"
DB_CONN_STR: postgresql://postgres:mysecretpassword@localhost:5432/postgres?sslmode=disable
# DB_CONN_STR: '"root:your_password@tcp(127.0.0.1:3306)/blog?multiStatements=true&parseTime=true"'
LOG_LEVEL: debug
TEMPL_VERSION: v0.2.778
SQLC_VERSION: v1.27.0
GOLANGCILINT_VERSION: v1.60.3
Expand Down Expand Up @@ -59,28 +51,11 @@ tasks:
- go test ./...
deps:
- assets
# - lint

run:
desc: Run the app as a local server
deps:
- assets
- generate
- test
cmds:
- go run ./cmd/server/... --port {{.PORT}} --api-key {{.API_KEY}} --db-connection-string {{.DB_CONN_STR}} --log-level {{.LOG_LEVEL}}

docker-build:
desc: Build the blogserver container using docker
deps:
- test
cmds:
- docker build . -t {{.NAME}}:{{.TAG}}

docker-run:
desc: Run the blogserver container using docker
deps:
- docker-build
- test
cmds:
- docker run -p {{.PORT}} {{.NAME}}:{{.TAG}} --port {{.PORT}} --api-key {{.API_KEY}} --db-connection-string {{.DB_CONN_STR}} --log-level {{.LOG_LEVEL}}
- docker compose up

4 changes: 2 additions & 2 deletions components/social_media_icons.templ
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package components

const (
GitHubUsername = "jannawro"
ItchIOUsername = "jannawro"
LinkedInUsername = "jannawro"
ItchIOUsername = "areddoor"
LinkedInUsername = "jan-nawrocki-721998218"
)

templ SocialMediaIcons() {
Expand Down
10 changes: 4 additions & 6 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# fly.toml app configuration file generated for a-red-door-blog on 2024-09-28T13:42:34+02:00
# fly.toml app configuration file generated for a-red-door-blog on 2024-09-28T17:25:04+02:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'a-red-door-blog'
primary_region = 'waw'

[build]
[env]
LOG_LEVEL = 'info'
PORT = '8080'

[http_service]
internal_port = 8080
Expand All @@ -18,7 +20,3 @@ primary_region = 'waw'

[[vm]]
size = 'shared-cpu-1x'

[env]
PORT = "8080"
LOG_LEVEL = "info"
24 changes: 24 additions & 0 deletions handlers/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@ video {
display: none;
}

.h-6 {
height: 1.5rem;
}

.h-auto {
height: auto;
}
Expand All @@ -675,6 +679,10 @@ video {
width: 8rem;
}

.w-6 {
width: 1.5rem;
}

.w-auto {
width: auto;
}
Expand Down Expand Up @@ -723,6 +731,12 @@ video {
gap: 2rem;
}

.space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

.space-y-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
Expand Down Expand Up @@ -877,6 +891,11 @@ video {
color: rgb(245 245 245 / var(--tw-text-opacity));
}

.text-gray-600 {
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}

.shadow-lg {
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
Expand Down Expand Up @@ -923,6 +942,11 @@ video {
color: rgb(245 245 245 / var(--tw-text-opacity));
}

.hover\:text-gray-800:hover {
--tw-text-opacity: 1;
color: rgb(31 41 55 / var(--tw-text-opacity));
}

.hover\:underline:hover {
text-decoration-line: underline;
}
Expand Down

0 comments on commit 888e0e6

Please sign in to comment.