-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #813 from zmariscal/feature--add-dockerfile-and-co…
…mpose-file Feature: Add Dockerfile and compose file
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use the official Ruby 3.2 image as a base image | ||
ARG RUBY_VERSION=3.2 | ||
FROM ruby:${RUBY_VERSION}-bullseye | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Install system packages | ||
RUN apt-get update -qq && \ | ||
apt-get install -y default-mysql-client vim && \ | ||
apt-get clean | ||
|
||
# Set environment variables | ||
ENV AR_VERSION=7.0 | ||
|
||
# Copy all files | ||
COPY . . | ||
|
||
# Move sample database.yml and install gems | ||
RUN mv test/database.yml.sample test/database.yml && \ | ||
bundle install | ||
|
||
CMD ["irb"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: "3.5" | ||
|
||
services: | ||
mysql: | ||
platform: linux/x86_64 | ||
image: mysql:5.7 | ||
volumes: | ||
- mysql-data:/var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
|
||
app: | ||
build: | ||
context: . | ||
environment: | ||
DB_HOST: mysql | ||
AR_VERSION: 7.0 | ||
volumes: | ||
- .:/usr/src/app | ||
depends_on: | ||
- mysql | ||
command: tail -f /dev/null | ||
|
||
volumes: | ||
mysql-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ common: &common | |
mysql2: &mysql2 | ||
<<: *common | ||
adapter: mysql2 | ||
host: mysql | ||
|
||
mysql2spatial: | ||
<<: *mysql2 | ||
|