-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
33 lines (28 loc) · 1.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM crystallang/crystal:1.10.1 AS base
RUN apt-get -q update && \
apt-get -qy install --no-install-recommends build-essential git wget libssl-dev libxml2-dev libyaml-0-2 libreadline-dev netcat libsqlite3-dev
WORKDIR /crecto
COPY shard.yml /crecto/
RUN shards install
ENTRYPOINT ["/crecto/bin/specs"]
FROM base AS sqlite
RUN apt-get -q update && apt-get -qy install --no-install-recommends sqlite3
COPY bin /crecto/bin
COPY spec /crecto/spec
COPY src /crecto/src
COPY ./spec/migrations/sqlite3_migrations.sql /crecto/spec/migrations/
CMD ["sqlite"]
FROM base AS postgres
RUN apt-get -q update && apt-get -qy install --no-install-recommends libpq-dev postgresql-client
COPY bin /crecto/bin
COPY spec /crecto/spec
COPY src /crecto/src
COPY ./spec/migrations/pg_migrations.sql /crecto/spec/migrations/
CMD ["postgres"]
FROM base AS mysql
RUN apt-get -q update && apt-get -qy install --no-install-recommends mysql-client libmysqlclient-dev
COPY bin /crecto/bin
COPY spec /crecto/spec
COPY src /crecto/src
COPY ./spec/migrations/mysql_migrations.sql /crecto/spec/migrations/
CMD ["mysql"]