Skip to content

Commit

Permalink
Docker: Move files to the top directory.
Browse files Browse the repository at this point in the history
This removes symlinks which are particularly troublesome on
Win32 systems. This fixes #104
  • Loading branch information
hmdne authored and ronaldtse committed Jun 22, 2024
1 parent 8835c86 commit 9db2d78
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 62 deletions.
35 changes: 0 additions & 35 deletions .docker/Makefile

This file was deleted.

14 changes: 0 additions & 14 deletions .docker/docker-compose.yml

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion Makefile

This file was deleted.

35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export SPEC ?= spec
SPEC_FILE = $(subst ../,, $(SPEC))
export RUBY_IMAGE ?= ruby:3.1.2-slim

.PHONY: up
up:
docker-compose up

.PHONY: down
down:
docker-compose down

.PHONY: test
test: rspec

.PHONY: ssh
ssh:
docker-compose run lib bash

.PHONY: install
install:
docker-compose run lib bin/setup

.PHONY: console
console:
docker-compose run lib bin/console

.PHONY: rspec
rspec:
docker-compose run lib bin/rspec ${SPEC_FILE}

.PHONY: setup
setup:
docker-compose build --build-arg RUBY_IMAGE=${RUBY_IMAGE}
docker-compose run lib bin/setup
13 changes: 2 additions & 11 deletions .docker/readme.md → README.Docker.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
## Docker

This directory is only meant to be used for development, and contains some
This Docker image is only meant to be used for development, and contains some
necessary setup to spin up docker containers with multiple ruby environment.

### Setup

Before doing anything, you might want to create a symlink to the docker file and
Makefile. This would allow you to avoid some of the unnecessary work related to
the file paths To do that run the following from the root of the project.

```
ln -sf .docker/Makefile .
ln -sf .docker/docker-compose.yml .
```

By default it usages the most recent ruby version for docker environment, but if
By default it uses the most recent ruby version for docker environment, but if
you want to run it in any specific version then you can set it up by exporting
`RUBY_IMAGE` environment variable in your shell:

Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml

This file was deleted.

14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
lib:
build:
context: .
dockerfile: ./Dockerfile

volumes:
- .:/workspace:z
- bundle:/bundle:z

volumes:
bundle:

0 comments on commit 9db2d78

Please sign in to comment.