Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to import sicp in sandbox #1350

Merged
merged 2 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 28 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
FROM php:8.1-cli
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Moscow
ENV PATH=node_modules/.bin:$PATH

WORKDIR /app

RUN apt-get update && apt-get install -y \
make \
curl \
git \
libpq-dev \
libzip-dev \
racket \
sqlite3 \
unzip \
zip \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
php \
php-bcmath \
php-exif \
php-pdo \
php-pgsql \
php-pgsql \
php-zip \
php-xdebug \
php-dom \
php-xml \
php-mbstring \
php-sqlite3 \
php-curl

RUN docker-php-ext-install \
bcmath \
exif \
pdo \
pdo_pgsql \
pgsql \
zip
RUN apt-get update && apt-get install -y \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*

RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN add-apt-repository -y ppa:plt/racket
RUN apt update && apt-get install -y racket
RUN raco pkg install sicp

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

COPY ./xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get update && apt-get install -y nodejs

RUN apt-get install -y nodejs
RUN npm install --location=global npm@latest

# NOTE:fix for EACCES: permission denied
# https://stackoverflow.com/questions/60047304/npm-err-code-elifecycle-npm-err-errno-243
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o sicp
RUN useradd -m -u $UID -g $GID -o -s /bin/bash sicp
USER sicp
ENV PATH=node_modules/.bin:$PATH
2 changes: 1 addition & 1 deletion make-compose.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ compose-bash:
docker-compose run --rm application bash

compose-build:
docker-compose build ${BUILD_ARGS}
docker-compose build

compose-console:
docker-compose run --rm application make console
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"production": "mix --production",
"prod": "npm run production",
"heroku-postbuild": "npm run production",
"lint-js": "npx eslint --ext .jsx,.js ./resources/js",
"lint-js-fix": "npx eslint --fix --ext .jsx,.js ./resources/js"
"lint-js": "node_modules/.bin/eslint --ext .jsx,.js ./resources/js",
"lint-js-fix": "node_modules/.bin/eslint --fix --ext .jsx,.js ./resources/js"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(define base-module-eval
(make-module-evaluator '(module m racket/base
(require rackunit)
(require rackunit sicp)
;;; BEGIN
{!! $solution !!}
;;; END
Expand Down