generated from alecodes/base-template
chore: add development workflow with compose watch
This commit is contained in:
parent
f937122a2a
commit
9194eccab9
4 changed files with 41 additions and 8 deletions
|
|
@ -1,7 +1,22 @@
|
||||||
# FROM ghcr.io/linuxcontainers/debian-slim:latest
|
FROM ghcr.io/linuxcontainers/debian-slim:latest
|
||||||
|
|
||||||
FROM lovasoa/sqlpage
|
|
||||||
|
|
||||||
COPY --from=ghcr.io/amacneil/dbmate /usr/local/bin/dbmate /usr/local/bin/dbmate
|
COPY --from=ghcr.io/amacneil/dbmate /usr/local/bin/dbmate /usr/local/bin/dbmate
|
||||||
|
COPY --from=lovasoa/sqlpage:latest /usr/local/bin/sqlpage /usr/local/bin/sqlpage
|
||||||
|
COPY --from=lovasoa/sqlpage:latest /lib/libgcc_s.so.1 /lib/libgcc_s.so.1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV SQLPAGE_WEB_ROOT=/app
|
||||||
|
ENV SQLPAGE_CONFIGURATION_DIRECTORY=/etc/sqlpage
|
||||||
|
|
||||||
|
RUN addgroup --gid 1000 --system index_user && \
|
||||||
|
adduser --uid 1000 --system --no-create-home --ingroup index_user index_user && \
|
||||||
|
mkdir -p /etc/sqlpage && \
|
||||||
|
touch /etc/sqlpage/sqlpage.db && \
|
||||||
|
chown -R index_user:index_user /etc/sqlpage/sqlpage.db
|
||||||
|
|
||||||
|
COPY --chown=index_user:index_user ./src /app
|
||||||
|
|
||||||
|
USER index_user
|
||||||
|
|
||||||
|
CMD /usr/local/bin/sqlpage
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,17 @@ services:
|
||||||
index:
|
index:
|
||||||
image: alecodes/index:latest
|
image: alecodes/index:latest
|
||||||
pull_policy: build
|
pull_policy: build
|
||||||
user: 1000:1000
|
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: ./docker/Dockerfile
|
dockerfile: ./docker/Dockerfile
|
||||||
|
develop:
|
||||||
|
watch:
|
||||||
|
- action: sync
|
||||||
|
path: ../src
|
||||||
|
target: /app
|
||||||
|
ports:
|
||||||
|
- 3000:8080
|
||||||
env_file: ../.env
|
env_file: ../.env
|
||||||
volumes:
|
|
||||||
- ../src:/app
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:17
|
image: postgres:17
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
-- migrate:up
|
-- migrate:up
|
||||||
|
CREATE TABLE public.sources (
|
||||||
|
id serial PRIMARY KEY,
|
||||||
|
name character varying(20) NOT NULL,
|
||||||
|
uid character varying(8) NOT NULL,
|
||||||
|
uri character varying NOT NULL,
|
||||||
|
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||||
|
updated_at timestamp with time zone,
|
||||||
|
deleted_at timestamp with time zone
|
||||||
|
);
|
||||||
|
|
||||||
-- migrate:down
|
-- migrate:down
|
||||||
|
DROP TABLE public.sources;
|
||||||
|
|
|
||||||
6
src/index.sql
Normal file
6
src/index.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
SELECT 'list' AS component,
|
||||||
|
'Popular websites TESTOOO' AS title;
|
||||||
|
|
||||||
|
SELECT 'Hello' AS title,
|
||||||
|
'world' AS description,
|
||||||
|
'https://wikipedia.org' AS link;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue