Skip to content

Instantly share code, notes, and snippets.

@haarts
Created June 28, 2021 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haarts/93f58b2026f7148e3b13085658cb266f to your computer and use it in GitHub Desktop.
Save haarts/93f58b2026f7148e3b13085658cb266f to your computer and use it in GitHub Desktop.
Dockerfile for running Lucky
FROM docker.io/crystallang/crystal:1.0.0
RUN apt update && apt install -y curl gpg postgresql-client tmux
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update && \
apt install -y nodejs yarn
ADD https://github.com/DarthSim/overmind/releases/download/v2.2.2/overmind-v2.2.2-linux-amd64.gz .
RUN gunzip overmind-v2.2.2-linux-amd64.gz && \
chmod +x overmind-v2.2.2-linux-amd64 && \
mv overmind-v2.2.2-linux-amd64 /usr/local/bin/overmind
RUN git clone https://github.com/luckyframework/lucky_cli && \
cd lucky_cli && \
git checkout v0.27.0 && \
shards install && \
crystal build src/lucky.cr && \
mv lucky /usr/local/bin
CMD ["bash"]
@haarts
Copy link
Author

haarts commented Jun 28, 2021

This gist assumes you are running Postgres in an other container.

I happen to run Podman. The Postgres container is run with:

$ podman run -p 3001:3001 -p 5432:5432 --pod new:my_pod  -e POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256 -e POSTGRES_HOST_AUTH_METHOD=scram-sha
-256  -e POSTGRES_PASSWORD=a  docker.io/library/postgres:13.3-alpine

This creates a new pod for easy network sharing.

$ podman run -v /some/path/to/the/root/of/your/app:/app -it --pod my_pod lucky bash

Run the container with Lucky in it. You can then go ahead there and run lucky dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment