feat: with initial rust service
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
4
templates/.env.example.tmpl
Normal file
4
templates/.env.example.tmpl
Normal file
@@ -0,0 +1,4 @@
|
||||
POSTGRES_DB=como
|
||||
POSTGRES_USER=como
|
||||
POSTGRES_PASSWORD=somenotverysecurepassword
|
||||
DATABASE_URL="postgres://como:somenotverysecurepassword@localhost:5432/como"
|
@@ -1,11 +0,0 @@
|
||||
FROM rust:1.69.0-slim-buster
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y
|
||||
RUN apt-get install libssl-dev
|
||||
RUN apt-get install -y -q build-essential curl
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo build
|
||||
|
||||
CMD [ "cargo", "run" ]
|
@@ -1,2 +0,0 @@
|
||||
target/
|
||||
.cuddle/
|
@@ -1,17 +0,0 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
{{ service }}:
|
||||
image: {{ image }}
|
||||
ports:
|
||||
- {{ port }}
|
||||
env_file: ".env"
|
||||
restart: always
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: postgres:13.5
|
||||
restart: always
|
||||
env_file: ".env"
|
||||
volumes:
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
7
templates/docker-compose.local_up.dockerignore
Normal file
7
templates/docker-compose.local_up.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
||||
target/
|
||||
.git/
|
||||
.cuddle/
|
||||
scripts/
|
||||
cuddle.yaml
|
||||
local.sh
|
||||
README.md
|
17
templates/docker-compose.local_up.yml.tmpl
Normal file
17
templates/docker-compose.local_up.yml.tmpl
Normal file
@@ -0,0 +1,17 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
db:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: local_up.Dockerfile
|
||||
restart: always
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=somenotverysecurepassword
|
||||
ports:
|
||||
- 5432:5432
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
pgdata:
|
8
templates/init-user-db.sh
Normal file
8
templates/init-user-db.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE USER como WITH PASSWORD 'somenotverysecurepassword';
|
||||
CREATE DATABASE cuddle;
|
||||
GRANT ALL PRIVILEGES ON DATABASE cuddle TO cuddle;
|
||||
EOSQL
|
3
templates/local_up.Dockerfile
Normal file
3
templates/local_up.Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM postgres:14-alpine
|
||||
|
||||
COPY *.sh /docker-entrypoint-initdb.d/
|
Reference in New Issue
Block a user