mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 19:13:51 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
99e1cd5639
|
|||
|
7446d8296a
|
|||
|
6b424ae8e4
|
|||
|
04489a53d1
|
|||
|
b40134833b
|
@@ -1,5 +1,5 @@
|
||||
timmypidashev.local {
|
||||
tls internal
|
||||
|
||||
reverse_proxy web:4321
|
||||
reverse_proxy timmypidashev.dev:4321
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
timmypidashev.dev {
|
||||
tls pidashev.tim@gmail.com
|
||||
|
||||
reverse_proxy 127.0.0.1:3000
|
||||
reverse_proxy timmypidashev.dev:3000
|
||||
}
|
||||
@@ -36,10 +36,13 @@ FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# Install serve
|
||||
RUN npm install -g serve
|
||||
RUN npm install -g http-server
|
||||
|
||||
# Copy built files
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Expose port 3000
|
||||
EXPOSE 3000
|
||||
CMD ["serve", "-s", "dist", "-l", "3000"]
|
||||
|
||||
# Deployment command
|
||||
CMD ["http-server", "dist", "-a", "127.0.0.1", "-p", "3000"]
|
||||
|
||||
30
Makefile
30
Makefile
@@ -1,13 +1,13 @@
|
||||
PROJECT_NAME := "timmypidashev.dev"
|
||||
PROJECT_AUTHORS := "Timothy Pidashev (timmypidashev) <pidashev.tim@gmail.com>"
|
||||
PROJECT_VERSION := "v1.0.1"
|
||||
PROJECT_VERSION := "v1.0.2"
|
||||
PROJECT_LICENSE := "MIT"
|
||||
PROJECT_SOURCES := "https://github.com/timmypidashev/web"
|
||||
PROJECT_REGISTRY := "ghcr.io/timmypidashev/web"
|
||||
PROJECT_REGISTRY := "ghcr.io/timmypidashev"
|
||||
PROJECT_ORGANIZATION := "org.opencontainers"
|
||||
|
||||
CONTAINER_WEB_NAME := "web"
|
||||
CONTAINER_WEB_VERSION := "v1.0.1"
|
||||
CONTAINER_WEB_NAME := "timmypidashev.dev"
|
||||
CONTAINER_WEB_VERSION := "v2.1.1"
|
||||
CONTAINER_WEB_LOCATION := "src/"
|
||||
CONTAINER_WEB_DESCRIPTION := "My portfolio website!"
|
||||
|
||||
@@ -17,7 +17,7 @@ CONTAINER_WEB_DESCRIPTION := "My portfolio website!"
|
||||
|
||||
help:
|
||||
@echo "Available targets:"
|
||||
@echo " run - Runs the docker compose file with the specified environment (dev or release)"
|
||||
@echo " run - Runs the docker compose file with the specified environment (local or release)"
|
||||
@echo " build - Builds the specified docker image with the appropriate environment"
|
||||
@echo " push - Pushes the built docker image to the registry"
|
||||
@echo " prune - Removes all built and cached docker images and containers"
|
||||
@@ -25,19 +25,19 @@ help:
|
||||
|
||||
run:
|
||||
# Arguments:
|
||||
# [environment]: 'dev' or 'release'
|
||||
# [environment]: 'local' or 'release'
|
||||
#
|
||||
# Explanation:
|
||||
# * Runs the docker compose file with the specified environment(compose.dev.yml, or compose.release.yml)
|
||||
# * Runs the docker compose file with the specified environment(compose.local.yml, or compose.release.yml)
|
||||
# * Passes all generated arguments to the compose file.
|
||||
|
||||
# Make sure we have been given proper arguments.
|
||||
@if [ "$(word 2,$(MAKECMDGOALS))" = "dev" ]; then \
|
||||
echo "Running in development environment"; \
|
||||
@if [ "$(word 2,$(MAKECMDGOALS))" = "local" ]; then \
|
||||
echo "Running in local environment"; \
|
||||
elif [ "$(word 2,$(MAKECMDGOALS))" = "release" ]; then \
|
||||
echo "Running in release environment"; \
|
||||
else \
|
||||
echo "Invalid usage. Please use 'make run dev' or 'make run release'"; \
|
||||
echo "Invalid usage. Please use 'make run local' or 'make run release'"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
@@ -47,7 +47,7 @@ run:
|
||||
build:
|
||||
# Arguments
|
||||
# [container]: Build context(which container to build ['all' to build every container defined])
|
||||
# [environment]: 'dev' or 'release'
|
||||
# [environment]: 'local' or 'release'
|
||||
#
|
||||
# Explanation:
|
||||
# * Builds the specified docker image with the appropriate environment.
|
||||
@@ -155,19 +155,19 @@ define container_build
|
||||
$(eval ENVIRONMENT := $(word 2,$1))
|
||||
$(eval ARGS := $(shell echo $(args)))
|
||||
$(eval VERSION := $(strip $(call container_version,$(CONTAINER))))
|
||||
$(eval TAG := $(CONTAINER):$(ENVIRONMENT))
|
||||
$(eval TAG := $(PROJECT_NAME):$(ENVIRONMENT))
|
||||
|
||||
@echo "Building container: $(CONTAINER)"
|
||||
@echo "Environment: $(ENVIRONMENT)"
|
||||
@echo "Version: $(VERSION)"
|
||||
|
||||
@if [ "$(strip $(ENVIRONMENT))" != "dev" ] && [ "$(strip $(ENVIRONMENT))" != "release" ]; then \
|
||||
echo "Invalid environment. Please specify 'dev' or 'release'"; \
|
||||
@if [ "$(strip $(ENVIRONMENT))" != "local" ] && [ "$(strip $(ENVIRONMENT))" != "release" ]; then \
|
||||
echo "Invalid environment. Please specify 'local' or 'release'"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
$(if $(filter $(strip $(ENVIRONMENT)),release), \
|
||||
$(eval TAG := $(PROJECT_REGISTRY)/$(CONTAINER):$(VERSION)), \
|
||||
$(eval TAG := $(PROJECT_REGISTRY)/$(PROJECT_NAME):$(VERSION)), \
|
||||
)
|
||||
|
||||
docker buildx build --load -t $(TAG) -f .docker/Dockerfile.$(ENVIRONMENT) ./$(strip $(subst $(SPACE),,$(call container_location,$(CONTAINER))))/. $(ARGS) $(call labels,$(shell echo $(CONTAINER_NAME) | tr '[:lower:]' '[:upper:]')) --no-cache
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
services:
|
||||
caddy:
|
||||
container_name: proxy
|
||||
image: caddy:latest
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
volumes:
|
||||
- ./.caddy/Caddyfile.dev:/etc/caddy/Caddyfile:rw
|
||||
networks:
|
||||
- web_proxy
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
web:
|
||||
container_name: web
|
||||
image: web:dev
|
||||
volumes:
|
||||
- ./src/node_modules:/app/node_modules
|
||||
- ./src/sandbox.config.json:/app/sandbox.config.json
|
||||
- ./src/.stackblitzrc:/app/.stackblitzrc
|
||||
- ./src/astro.config.mjs:/app/astro.config.mjs
|
||||
- ./src/tailwind.config.cjs:/app/tailwind.config.cjs
|
||||
- ./src/tsconfig.json:/app/tsconfig.json
|
||||
- ./src/pnpm-lock.yaml:/app/pnpm-lock.yaml
|
||||
- ./src/package.json:/app/package.json
|
||||
- ./src/public:/app/public
|
||||
- ./src/src:/app/src
|
||||
networks:
|
||||
- web_proxy
|
||||
|
||||
networks:
|
||||
web_proxy:
|
||||
name: web_proxy
|
||||
external: true
|
||||
0
compose.local.yml
Normal file
0
compose.local.yml
Normal file
@@ -1,20 +1,28 @@
|
||||
services:
|
||||
caddy:
|
||||
container_name: proxy
|
||||
container_name: caddy
|
||||
image: caddy:latest
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
volumes:
|
||||
- ./.caddy/Caddyfile.dev:/etc/caddy/Caddyfile:rw
|
||||
- ./.caddy/Caddyfile.release:/etc/caddy/Caddyfile:rw
|
||||
networks:
|
||||
- proxy_network
|
||||
depends_on:
|
||||
- release.timmypidashev.dev
|
||||
- timmypidashev.dev
|
||||
|
||||
watchtower:
|
||||
container_name: updates
|
||||
image: containrrr/watchtower
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- $HOME/.docker/config.json:/config.json
|
||||
command: --interval 120 --cleanup --label-enable
|
||||
|
||||
release.timmypidashev.dev:
|
||||
timmypidashev.dev:
|
||||
container_name: timmypidashev
|
||||
image: ghcr.io/timmypidashev/timmypidashev.dev:release
|
||||
image: ghcr.io/timmypidashev/timmypidashev.dev:latest
|
||||
networks:
|
||||
- proxy_network
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "src",
|
||||
"version": "v2.1.0",
|
||||
"version": "2.1.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "astro dev --host",
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// schemas/prisma.schema
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql" // or "mysql" or "sqlite" depending on your database
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
githubId Int @unique @map("github_id")
|
||||
email String @unique
|
||||
username String
|
||||
sessions Session[]
|
||||
|
||||
@@index([githubId])
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id
|
||||
userId Int @map("user_id")
|
||||
expiresAt DateTime @map("expires_at")
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
}
|
||||
Reference in New Issue
Block a user