ci: Dockerfile + docker-compose

This commit is contained in:
Juan Rodriguez
2024-05-14 05:50:28 +02:00
parent adbc07e605
commit abb35019f3
3 changed files with 34 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
.git
/bin/
/.shards/
/bruno/
/spec/
/sqlite/
+19
View File
@@ -0,0 +1,19 @@
FROM alpine:edge as base
WORKDIR /usr/src/app
RUN apk add crystal shards sqlite-dev openssl-dev
FROM base AS build
ENV ENV=production
COPY . .
RUN shards install
RUN shards build --progress
FROM base AS release
COPY --from=build /usr/src/app/bin/migrate .
COPY --from=build /usr/src/app/bin/url-shortener .
COPY --from=build /usr/src/app/bin/cli .
EXPOSE 4000/tcp
CMD ["./url-shortener"]
+9
View File
@@ -0,0 +1,9 @@
services:
app:
build: .
environment:
ENV: production
DATABASE_URL: sqlite3://./sqlite/data.db?journal_mode=wal&synchronous=normal&foreign_keys=true
APP_URL: http://0.0.0.0:4001
ports:
- 4001:4001