Skip to content

Commit

Permalink
Dj/multi architecture docker image (#498)
Browse files Browse the repository at this point in the history
* fix: support multi-architecture docker image

* fix: remove sqlite client

* fix: trailing spaces reported by ameba

* fix:remove special command
  • Loading branch information
drujensen authored Oct 28, 2023
1 parent faa7ea2 commit d756079
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM crystallang/crystal:1.8.0

ARG sqlite_version=3110000
ARG sqlite_version_year=2016
FROM 84codes/crystal:latest-ubuntu-jammy

# Install deps
RUN apt-get update -qq && apt-get install -y --no-install-recommends libpq-dev libmysqlclient-dev libsqlite3-dev wget unzip lib32z1
RUN apt-get update -qq && apt-get install -y --no-install-recommends libpq-dev libmysqlclient-dev libsqlite3-dev

WORKDIR /app/user

COPY shard.yml ./
COPY shard.yml /app/user
COPY shard.lock /app/user
RUN shards install

COPY . /app/user
COPY src /app/user/src
COPY spec /app/user/spec

RUN wget -O sqlite.zip https://www.sqlite.org/$sqlite_version_year/sqlite-tools-linux-x86-$sqlite_version.zip && unzip -d /usr/bin/ -j sqlite.zip && rm sqlite.zip
ENTRYPOINT []
4 changes: 0 additions & 4 deletions docker/docker-compose.sqlite.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
version: '2'
services:
spec:
command: 'bash -c "cd /app/user && bin/ameba && crystal tool format --check && sqlite3 --version && crystal spec"'
extends:
file: ../docker-compose.yml
service: spec
build:
context: ../
args:
sqlite_version: ${SQLITE_VERSION}
sqlite_version_year: ${SQLITE_VERSION_YEAR}
environment:
CURRENT_ADAPTER: sqlite
2 changes: 1 addition & 1 deletion src/granite/querying.cr
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ module Granite::Querying
# ```
def reload
{% if !@top_level.has_constant? "Spec" %}
raise "#reload is a convenience method for testing only, please use #find in your application code"
raise "#reload is a convenience method for testing only, please use #find in your application code"
{% end %}
self.class.find!(primary_key_value)
end
Expand Down

0 comments on commit d756079

Please sign in to comment.