ci: Dockerfile + docker-compose
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
.git
|
||||
/bin/
|
||||
/.shards/
|
||||
/bruno/
|
||||
/spec/
|
||||
/sqlite/
|
||||
+19
@@ -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"]
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user